Skip to content
This repository has been archived by the owner on Mar 21, 2024. It is now read-only.

Commit

Permalink
Return P0571R2 logic for scan by key
Browse files Browse the repository at this point in the history
  • Loading branch information
gevtushenko committed Aug 3, 2022
1 parent 70c5e48 commit 20ba21c
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions thrust/system/cuda/detail/scan_by_key.h
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ ValuesOutIt inclusive_scan_by_key_n(
thrust::detail::try_unwrap_contiguous_iterator_return_t<ValuesInIt>;
using ValuesOutUnwrapIt =
thrust::detail::try_unwrap_contiguous_iterator_return_t<ValuesOutIt>;
using AccumT = typename thrust::iterator_traits<ValuesInUnwrapIt>::value_type;

auto keys_unwrap = thrust::detail::try_unwrap_contiguous_iterator(keys);
auto values_unwrap = thrust::detail::try_unwrap_contiguous_iterator(values);
Expand All @@ -98,14 +99,16 @@ ValuesOutIt inclusive_scan_by_key_n(
EqualityOpT,
ScanOpT,
cub::NullType,
thrust::detail::int32_t>;
thrust::detail::int32_t,
AccumT>;
using Dispatch64 = cub::DispatchScanByKey<KeysInUnwrapIt,
ValuesInUnwrapIt,
ValuesOutUnwrapIt,
EqualityOpT,
ScanOpT,
cub::NullType,
thrust::detail::int64_t>;
thrust::detail::int64_t,
AccumT>;

cudaStream_t stream = thrust::cuda_cub::stream(policy);
cudaError_t status{};
Expand Down Expand Up @@ -209,14 +212,16 @@ ValuesOutIt exclusive_scan_by_key_n(
EqualityOpT,
ScanOpT,
InitValueT,
thrust::detail::int32_t>;
thrust::detail::int32_t,
InitValueT>;
using Dispatch64 = cub::DispatchScanByKey<KeysInUnwrapIt,
ValuesInUnwrapIt,
ValuesOutUnwrapIt,
EqualityOpT,
ScanOpT,
InitValueT,
thrust::detail::int64_t>;
thrust::detail::int64_t,
InitValueT>;

cudaStream_t stream = thrust::cuda_cub::stream(policy);
cudaError_t status{};
Expand Down

0 comments on commit 20ba21c

Please sign in to comment.