Skip to content
Open
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
38 changes: 14 additions & 24 deletions cub/cub/device/device_adjacent_difference.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -635,11 +635,9 @@ struct DeviceAdjacentDifference
{
_CCCL_NVTX_RANGE_SCOPE("cub::DeviceAdjacentDifference::SubtractLeftCopy");

using OffsetT = detail::choose_offset_t<NumItemsT>;
using default_policy_selector = detail::adjacent_difference::policy_selector_from_types<InputIteratorT, false>;

return detail::dispatch_with_env_and_tuning<default_policy_selector>(
env, [&](auto policy_selector, void* d_temp_storage, size_t& temp_storage_bytes, cudaStream_t stream) {
using OffsetT = detail::choose_offset_t<NumItemsT>;
return detail::dispatch_with_env(
env, [&](auto tuning_env, void* d_temp_storage, size_t& temp_storage_bytes, cudaStream_t stream) {
return detail::adjacent_difference::dispatch<MayAlias::No, ReadOption::Left>(
d_temp_storage,
temp_storage_bytes,
Expand All @@ -648,7 +646,7 @@ struct DeviceAdjacentDifference
static_cast<OffsetT>(num_items),
difference_op,
stream,
policy_selector);
tuning_env);
});
}

Expand Down Expand Up @@ -721,11 +719,8 @@ struct DeviceAdjacentDifference
_CCCL_NVTX_RANGE_SCOPE("cub::DeviceAdjacentDifference::SubtractLeft");

using OffsetT = detail::choose_offset_t<NumItemsT>;
using default_policy_selector =
detail::adjacent_difference::policy_selector_from_types<RandomAccessIteratorT, true>;

return detail::dispatch_with_env_and_tuning<default_policy_selector>(
env, [&](auto policy_selector, void* d_temp_storage, size_t& temp_storage_bytes, cudaStream_t stream) {
return detail::dispatch_with_env(
env, [&](auto tuning_env, void* d_temp_storage, size_t& temp_storage_bytes, cudaStream_t stream) {
return detail::adjacent_difference::dispatch<MayAlias::Yes, ReadOption::Left>(
d_temp_storage,
temp_storage_bytes,
Expand All @@ -734,7 +729,7 @@ struct DeviceAdjacentDifference
static_cast<OffsetT>(num_items),
difference_op,
stream,
policy_selector);
tuning_env);
});
}

Expand Down Expand Up @@ -817,11 +812,9 @@ struct DeviceAdjacentDifference
{
_CCCL_NVTX_RANGE_SCOPE("cub::DeviceAdjacentDifference::SubtractRightCopy");

using OffsetT = detail::choose_offset_t<NumItemsT>;
using default_policy_selector = detail::adjacent_difference::policy_selector_from_types<InputIteratorT, false>;

return detail::dispatch_with_env_and_tuning<default_policy_selector>(
env, [&](auto policy_selector, void* d_temp_storage, size_t& temp_storage_bytes, cudaStream_t stream) {
using OffsetT = detail::choose_offset_t<NumItemsT>;
return detail::dispatch_with_env(
env, [&](auto tuning_env, void* d_temp_storage, size_t& temp_storage_bytes, cudaStream_t stream) {
return detail::adjacent_difference::dispatch<MayAlias::No, ReadOption::Right>(
d_temp_storage,
temp_storage_bytes,
Expand All @@ -830,7 +823,7 @@ struct DeviceAdjacentDifference
static_cast<OffsetT>(num_items),
difference_op,
stream,
policy_selector);
tuning_env);
});
}

Expand Down Expand Up @@ -903,11 +896,8 @@ struct DeviceAdjacentDifference
_CCCL_NVTX_RANGE_SCOPE("cub::DeviceAdjacentDifference::SubtractRight");

using OffsetT = detail::choose_offset_t<NumItemsT>;
using default_policy_selector =
detail::adjacent_difference::policy_selector_from_types<RandomAccessIteratorT, true>;

return detail::dispatch_with_env_and_tuning<default_policy_selector>(
env, [&](auto policy_selector, void* d_temp_storage, size_t& temp_storage_bytes, cudaStream_t stream) {
return detail::dispatch_with_env(
env, [&](auto tuning_env, void* d_temp_storage, size_t& temp_storage_bytes, cudaStream_t stream) {
return detail::adjacent_difference::dispatch<MayAlias::Yes, ReadOption::Right>(
d_temp_storage,
temp_storage_bytes,
Expand All @@ -916,7 +906,7 @@ struct DeviceAdjacentDifference
static_cast<OffsetT>(num_items),
difference_op,
stream,
policy_selector);
tuning_env);
});
}
};
Expand Down
17 changes: 7 additions & 10 deletions cub/cub/device/device_merge.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -192,10 +192,8 @@ struct DeviceMerge
{
_CCCL_NVTX_RANGE_SCOPE("cub::DeviceMerge::MergeKeys");

using default_policy_selector =
detail::merge::policy_selector_from_types<detail::it_value_t<KeyIteratorIn1>, NullType, int64_t>;
return detail::dispatch_with_env_and_tuning<default_policy_selector>(
env, [&](auto policy_selector, void* d_temp_storage, size_t& temp_storage_bytes, cudaStream_t stream) {
return detail::dispatch_with_env(
env, [&](auto tuning_env, void* d_temp_storage, size_t& temp_storage_bytes, cudaStream_t stream) {
return detail::merge::dispatch(
d_temp_storage,
temp_storage_bytes,
Expand All @@ -209,7 +207,7 @@ struct DeviceMerge
static_cast<NullType*>(nullptr),
compare_op,
stream,
policy_selector);
tuning_env);
});
}

Expand Down Expand Up @@ -416,10 +414,9 @@ struct DeviceMerge
EnvT env = {})
{
_CCCL_NVTX_RANGE_SCOPE("cub::DeviceMerge::MergePairs");
using default_policy_selector = detail::merge::
policy_selector_from_types<detail::it_value_t<KeyIteratorIn1>, detail::it_value_t<ValueIteratorIn1>, int64_t>;
return detail::dispatch_with_env_and_tuning<default_policy_selector>(
env, [&](auto policy_selector, void* d_temp_storage, size_t& temp_storage_bytes, cudaStream_t stream) {

return detail::dispatch_with_env(
env, [&](auto tuning_env, void* d_temp_storage, size_t& temp_storage_bytes, cudaStream_t stream) {
return detail::merge::dispatch(
d_temp_storage,
temp_storage_bytes,
Expand All @@ -433,7 +430,7 @@ struct DeviceMerge
values_out,
compare_op,
stream,
policy_selector);
tuning_env);
});
}
};
Expand Down
Loading
Loading