3575 bug shfl down sync bug causes undefined behavior #3576
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.
Fix for bug where warp primitives were called by threads outside mask, triggering a warp illegal instruction exception in CUDA versions > 12.2
Description
A bug has been uncovered by CUDA versions newer than 12.2 where calls to the __warp_down_sync primitive are being made by threads outside of the thread mask in the reduce_by_key header. Although this results in undefined behavior, in prior CUDA versions the primitive would execute successfully. This has changed since in newer versions since 12.2 where a warp illegal instruction exception is thrown.
The primitive wrapper functions header has been modified so that the full mask is always used to ensure the same behavior with old and new versions of CUDA. If a different mask is required, then the specific new version of the primitive can be called.
Fixes: #3575
Checklist