Skip to content
Closed
Changes from 1 commit
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
19 changes: 18 additions & 1 deletion include/cuco/reduction_functors.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -135,8 +135,25 @@ class reduction_functor : detail::reduction_functor_base {
Func,
cuda::atomic<value_type, cuda::thread_scope_thread>&,
value_type>;
static constexpr bool atomic_const_invocable_ =
cuda::std::is_invocable_r_v<value_type,
Func,
cuda::atomic<value_type, cuda::thread_scope_system> const&,
value_type> ||
cuda::std::is_invocable_r_v<value_type,
Func,
cuda::atomic<value_type, cuda::thread_scope_device> const&,
value_type> ||
cuda::std::is_invocable_r_v<value_type,
Func,
cuda::atomic<value_type, cuda::thread_scope_block> const&,
value_type> ||
cuda::std::is_invocable_r_v<value_type,
Func,
cuda::atomic<value_type, cuda::thread_scope_thread> const&,
value_type>;
Comment on lines +138 to +155

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Listing all possible values for cuda::thread_scope is very ugly. Does anyone have a better solution?


static_assert(atomic_invocable_ || naive_invocable_,
static_assert((atomic_invocable_ && !atomic_const_invocable_) || naive_invocable_,
"Invalid operator signature. Valid signatures are "
"(T const&, T const&)->T and (cuda::atomic<T, Scope>&, T const&)->T.");
static_assert(!(__nv_is_extended_device_lambda_closure_type(Func) ||
Expand Down