Add env overloads for inplace DeviceScan#8474
Merged
gonidelis merged 3 commits intoNVIDIA:mainfrom Apr 21, 2026
Merged
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. |
* Add literalinclude blocks to all 5 new in-place env overloads * Add missing ExclusiveScan(FutureValue) in-place tests * Constrain new in-place env overloads with !is_integral_v<EnvT> to prevent EnvT from silently deducing to num_items when the user calls the non-inplace overload with env defaulted. * Constrain existing non-inplace env overloads with is_integral_v<NumItemsT> to cut the symmetric ambiguity where NumItemsT would deduce to an env object. * Align docs throught env and non-env overloads * Wrap the EnvT default in the _CCCL_DOXYGEN_INVOKED guard to match the non-inplace style so Doxygen can render the signatures.
Contributor
bernhardmgruber
left a comment
There was a problem hiding this comment.
Please fix the enable_if, otherwise LGTM
| #endif | ||
| > | ||
| , | ||
| typename = ::cuda::std::enable_if_t<::cuda::std::is_integral_v<NumItemsT>>> |
Contributor
There was a problem hiding this comment.
Important: please move the enable_if from a default argument to an actual parameter. This makes SFINAE more robust. For a reason I forgot :S @miscco ?
Suggested change
| typename = ::cuda::std::enable_if_t<::cuda::std::is_integral_v<NumItemsT>>> | |
| ::cuda::std::enable_if_t<::cuda::std::is_integral_v<NumItemsT>, int> = 0> |
Applies to other overloads as well.
Member
Author
There was a problem hiding this comment.
is it because defaulted enable_if's with opposite conditions could still create ambiguities?
template <typename T, typename = enable_if_t< is_integral_v<T>>> void f(T);
template <typename T, typename = enable_if_t<!is_integral_v<T>>> void f(T); // redefinition error
Contributor
There was a problem hiding this comment.
Oh yes! That's the reason! Well done!
This comment has been minimized.
This comment has been minimized.
Contributor
🥳 CI Workflow Results🟩 Finished in 1h 51m: Pass: 100%/269 | Total: 9d 09h | Max: 1h 29m | Hits: 73%/177314See results here. |
bernhardmgruber
approved these changes
Apr 21, 2026
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.
leftover from #7548