[cudax] Prototype reduce function that takes a group#7699
Open
davebayer wants to merge 2 commits intoNVIDIA:mainfrom
Open
[cudax] Prototype reduce function that takes a group#7699davebayer wants to merge 2 commits intoNVIDIA:mainfrom
reduce function that takes a group#7699davebayer wants to merge 2 commits intoNVIDIA:mainfrom
Conversation
Contributor
|
Auto-sync is disabled for draft pull requests in this repository. Workflows must be run manually. Contributors can view more details about this message here. |
reduce function that takes a group
7d256c4 to
c021d1d
Compare
c021d1d to
25ea63b
Compare
fbusato
reviewed
Feb 18, 2026
| explicit sum_t() = default; | ||
|
|
||
| // todo: would it be nice if this_thread_group would be a concept? | ||
| // We could do operator()(cudax::this_thread_group auto group, ...) in C++20 |
| __device__ void operator()(const Config& config) | ||
| { | ||
| // todo: I want to write: | ||
| // coop::requires_shared_memory(coop::sum, cudax::this_thread(config), coop::value_type<unsigned>); |
Contributor
There was a problem hiding this comment.
this is fine. My concern is the potential instances explosion when we have reduce + predefined/user-defined operators
| // The problem is that the group holds a reference to the hierarchy, but that's unavailable in constexpr | ||
| // context. | ||
| constexpr auto thread_required_smem = | ||
| coop::required_shared_memory<decltype(cudax::this_thread(config))>(coop::sum, coop::value_type<unsigned>); |
Contributor
There was a problem hiding this comment.
would be this_thread_t better?
Comment on lines
+31
to
+35
| template <class T> | ||
| struct shared_memory_scratch | ||
| { | ||
| T& ref; | ||
| }; |
Contributor
There was a problem hiding this comment.
side comment. I never liked TempStorage approach for shared mem because it is opaque to the user and conversion could fall in UB. void* + compile-time size would make more sense IMO.
Contributor
😬 CI Workflow Results🟥 Finished in 1h 04m: Pass: 91%/48 | Total: 10h 50m | Max: 30m 47s | Hits: 75%/23531See results here. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Partially implements #7580