@@ -64,11 +64,6 @@ CUB_DETAIL_KERNEL_ATTRIBUTES void device_partition_merge_path_kernel(
64
64
Offset* merge_partitions,
65
65
CompareOp compare_op)
66
66
{
67
- static_assert (
68
- ::cuda::std::is_convertible<typename ::cuda::std::__invoke_of<CompareOp, value_t <KeyIt1>, value_t <KeyIt1>>::type,
69
- bool >::value,
70
- " Comparison operator must be convertible to bool" );
71
-
72
67
// items_per_tile must be the same of the merge kernel later, so we have to consider whether a fallback agent will be
73
68
// selected for the merge agent that changes the tile size
74
69
constexpr int items_per_tile =
@@ -121,9 +116,12 @@ __launch_bounds__(
121
116
Offset* merge_partitions,
122
117
vsmem_t global_temp_storage)
123
118
{
119
+ // the merge agent loads keys into a local array of KeyIt1::value_type, on which the comparisons are performed
120
+ using key_t = value_t <KeyIt1>;
121
+ static_assert (::cuda::std::__invokable<CompareOp, key_t , key_t >::value,
122
+ " Comparison operator cannot compare two keys" );
124
123
static_assert (
125
- ::cuda::std::is_convertible<typename ::cuda::std::__invoke_of<CompareOp, value_t <KeyIt1>, value_t <KeyIt1>>::type,
126
- bool >::value,
124
+ ::cuda::std::is_convertible<typename ::cuda::std::__invoke_of<CompareOp, key_t , key_t >::type, bool >::value,
127
125
" Comparison operator must be convertible to bool" );
128
126
129
127
using MergeAgent = typename choose_merge_agent<
@@ -218,15 +216,6 @@ template <typename KeyIt1,
218
216
typename PolicyHub = device_merge_policy_hub<value_t <KeyIt1>, value_t <ValueIt1>>>
219
217
struct dispatch_t
220
218
{
221
- using key_t = cub::detail::value_t <KeyIt1>;
222
- using value_t = cub::detail::value_t <ValueIt1>;
223
-
224
- // Cannot check output iterators, since they could be discard iterators, which do not have the right value_type
225
- static_assert (::cuda::std::is_same<cub::detail::value_t <KeyIt2>, key_t >::value, " " );
226
- static_assert (::cuda::std::is_same<cub::detail::value_t <ValueIt2>, value_t >::value, " " );
227
- static_assert (::cuda::std::__invokable<CompareOp, key_t , key_t >::value,
228
- " Comparison operator cannot compare two keys" );
229
-
230
219
void * d_temp_storage;
231
220
std::size_t & temp_storage_bytes;
232
221
KeyIt1 d_keys1;
@@ -351,7 +340,7 @@ struct dispatch_t
351
340
{
352
341
return error;
353
342
}
354
- dispatch_t dispatch{std::forward<Args>(args)...};
343
+ dispatch_t dispatch{::cuda:: std::forward<Args>(args)...};
355
344
error = CubDebug (PolicyHub::max_policy::Invoke (ptx_version, dispatch));
356
345
if (cudaSuccess != error)
357
346
{
0 commit comments