Skip to content

Add DeviceScan::*ByKey env algorithms#7970

Draft
gonidelis wants to merge 1 commit intoNVIDIA:mainfrom
gonidelis:scan_bykey_env
Draft

Add DeviceScan::*ByKey env algorithms#7970
gonidelis wants to merge 1 commit intoNVIDIA:mainfrom
gonidelis:scan_bykey_env

Conversation

@gonidelis
Copy link
Member

@gonidelis gonidelis commented Mar 10, 2026

partially fixes #7548 (one overload left)

do not review

@copy-pr-bot
Copy link
Contributor

copy-pr-bot bot commented Mar 10, 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.

@cccl-authenticator-app cccl-authenticator-app bot moved this from Todo to In Progress in CCCL Mar 10, 2026
typename InitValueT,
typename NumItemsT,
typename EnvT>
CUB_RUNTIME_FUNCTION _CCCL_FORCEINLINE static cudaError_t scan_bykey_impl_env(
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
CUB_RUNTIME_FUNCTION _CCCL_FORCEINLINE static cudaError_t scan_bykey_impl_env(
CUB_RUNTIME_FUNCTION _CCCL_FORCEINLINE static cudaError_t scan_by_key_impl_env(

NumItemsT num_items,
EnvT env)
{
// Dispatch with environment - handles all boilerplate
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggestion: remove the comment. It does not add any value.

Comment on lines +2491 to +2493
::cuda::std::enable_if_t<
!::cuda::std::is_same_v<KeysInputIteratorT, void*> && !::cuda::std::is_null_pointer_v<KeysInputIteratorT>,
int> = 0>
Copy link
Contributor

Choose a reason for hiding this comment

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

Remark: first time I see is_null_pointer_v. I think we need to do an eventual pass over all env overloads and make all constraints uniform (follow the same logic, etc.).

{
_CCCL_NVTX_RANGE_SCOPE("cub::DeviceScan::ExclusiveSumByKey");

using InitT = cub::detail::it_value_t<ValuesInputIteratorT>;
Copy link
Contributor

Choose a reason for hiding this comment

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

Important: Please follow the coding guidelines wrt. to the identifier naming:

Suggested change
using InitT = cub::detail::it_value_t<ValuesInputIteratorT>;
using init_t = cub::detail::it_value_t<ValuesInputIteratorT>;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: In Progress

Development

Successfully merging this pull request may close these issues.

Add env-based API for cub::DeviceScan

2 participants