Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Uses unsigned offset types in thrust's scan algorithms #3436

Merged
merged 1 commit into from
Jan 21, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions thrust/thrust/system/cuda/detail/async/exclusive_scan.h
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,8 @@ unique_eager_event async_exclusive_scan_n(
execution_policy<DerivedPolicy>& policy, ForwardIt first, Size n, OutputIt out, InitialValueType init, BinaryOp op)
{
using InputValueT = cub::detail::InputValue<InitialValueType>;
using Dispatch32 = cub::DispatchScan<ForwardIt, OutputIt, BinaryOp, InputValueT, std::int32_t, InitialValueType>;
using Dispatch64 = cub::DispatchScan<ForwardIt, OutputIt, BinaryOp, InputValueT, std::int64_t, InitialValueType>;
using Dispatch32 = cub::DispatchScan<ForwardIt, OutputIt, BinaryOp, InputValueT, std::uint32_t, InitialValueType>;
using Dispatch64 = cub::DispatchScan<ForwardIt, OutputIt, BinaryOp, InputValueT, std::uint64_t, InitialValueType>;

InputValueT init_value(init);

Expand All @@ -85,7 +85,7 @@ unique_eager_event async_exclusive_scan_n(
cudaError_t status;
size_t tmp_size = 0;
{
THRUST_INDEX_TYPE_DISPATCH2(
THRUST_UNSIGNED_INDEX_TYPE_DISPATCH2(
status,
Dispatch32::Dispatch,
Dispatch64::Dispatch,
Expand Down
6 changes: 3 additions & 3 deletions thrust/thrust/system/cuda/detail/async/inclusive_scan.h
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,8 @@ unique_eager_event
async_inclusive_scan_n(execution_policy<DerivedPolicy>& policy, ForwardIt first, Size n, OutputIt out, BinaryOp op)
{
using AccumT = typename thrust::iterator_traits<ForwardIt>::value_type;
using Dispatch32 = cub::DispatchScan<ForwardIt, OutputIt, BinaryOp, cub::NullType, std::int32_t, AccumT>;
using Dispatch64 = cub::DispatchScan<ForwardIt, OutputIt, BinaryOp, cub::NullType, std::int64_t, AccumT>;
using Dispatch32 = cub::DispatchScan<ForwardIt, OutputIt, BinaryOp, cub::NullType, std::uint32_t, AccumT>;
using Dispatch64 = cub::DispatchScan<ForwardIt, OutputIt, BinaryOp, cub::NullType, std::uint64_t, AccumT>;

auto const device_alloc = get_async_device_allocator(policy);
unique_eager_event ev;
Expand All @@ -78,7 +78,7 @@ async_inclusive_scan_n(execution_policy<DerivedPolicy>& policy, ForwardIt first,
cudaError_t status;
size_t tmp_size = 0;
{
THRUST_INDEX_TYPE_DISPATCH2(
THRUST_UNSIGNED_INDEX_TYPE_DISPATCH2(
status,
Dispatch32::Dispatch,
Dispatch64::Dispatch,
Expand Down
8 changes: 4 additions & 4 deletions thrust/thrust/system/cuda/detail/scan.h
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ _CCCL_HOST_DEVICE OutputIt inclusive_scan_n_impl(
OutputIt,
ScanOp,
InputValueT,
std::int32_t,
std::uint32_t,
AccumT,
cub::detail::scan::policy_hub<AccumT, ScanOp>,
ForceInclusive>;
Expand All @@ -137,7 +137,7 @@ _CCCL_HOST_DEVICE OutputIt inclusive_scan_n_impl(
OutputIt,
ScanOp,
InputValueT,
std::int64_t,
std::uint64_t,
AccumT,
cub::detail::scan::policy_hub<AccumT, ScanOp>,
ForceInclusive>;
Expand All @@ -154,7 +154,7 @@ _CCCL_HOST_DEVICE OutputIt inclusive_scan_n_impl(
// Determine temporary storage requirements:
size_t tmp_size = 0;
{
THRUST_INDEX_TYPE_DISPATCH2(
THRUST_UNSIGNED_INDEX_TYPE_DISPATCH2(
status,
Dispatch32::Dispatch,
Dispatch64::Dispatch,
Expand All @@ -170,7 +170,7 @@ _CCCL_HOST_DEVICE OutputIt inclusive_scan_n_impl(
{
// Allocate temporary storage:
thrust::detail::temporary_array<std::uint8_t, Derived> tmp{policy, tmp_size};
THRUST_INDEX_TYPE_DISPATCH2(
THRUST_UNSIGNED_INDEX_TYPE_DISPATCH2(
status,
Dispatch32::Dispatch,
Dispatch64::Dispatch,
Expand Down
Loading