Skip to content

Add env overloads for inplace DeviceScan#8474

Merged
gonidelis merged 3 commits intoNVIDIA:mainfrom
gonidelis:scan_inplace_env
Apr 21, 2026
Merged

Add env overloads for inplace DeviceScan#8474
gonidelis merged 3 commits intoNVIDIA:mainfrom
gonidelis:scan_inplace_env

Conversation

@gonidelis
Copy link
Copy Markdown
Member

leftover from #7548

@copy-pr-bot
Copy link
Copy Markdown
Contributor

copy-pr-bot Bot commented Apr 15, 2026

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.

@github-project-automation github-project-automation Bot moved this to Todo in CCCL Apr 15, 2026
@cccl-authenticator-app cccl-authenticator-app Bot moved this from Todo to In Progress in CCCL Apr 15, 2026
* 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.
@gonidelis gonidelis marked this pull request as ready for review April 20, 2026 19:57
@gonidelis gonidelis requested a review from a team as a code owner April 20, 2026 19:57
@gonidelis gonidelis requested a review from pauleonix April 20, 2026 19:57
@cccl-authenticator-app cccl-authenticator-app Bot moved this from In Progress to In Review in CCCL Apr 20, 2026
Copy link
Copy Markdown
Contributor

@bernhardmgruber bernhardmgruber left a comment

Choose a reason for hiding this comment

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

Please fix the enable_if, otherwise LGTM

Comment thread cub/cub/device/device_scan.cuh Outdated
#endif
>
,
typename = ::cuda::std::enable_if_t<::cuda::std::is_integral_v<NumItemsT>>>
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Oh yes! That's the reason! Well done!

@github-actions

This comment has been minimized.

@gonidelis gonidelis enabled auto-merge (squash) April 21, 2026 01:42
@github-actions
Copy link
Copy Markdown
Contributor

🥳 CI Workflow Results

🟩 Finished in 1h 51m: Pass: 100%/269 | Total: 9d 09h | Max: 1h 29m | Hits: 73%/177314

See results here.

@gonidelis gonidelis merged commit 2762a28 into NVIDIA:main Apr 21, 2026
286 of 289 checks passed
@github-project-automation github-project-automation Bot moved this from In Review to Done in CCCL Apr 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

2 participants