Skip to content

Add env based cub::DevicePartition and tests - #7459

Merged
bernhardmgruber merged 3 commits into
NVIDIA:mainfrom
gonidelis:partition_env
Feb 13, 2026
Merged

bernhardmgruber merged 3 commits into
NVIDIA:mainfrom
gonidelis:partition_env

Conversation

@gonidelis

Copy link
Copy Markdown
Member

fixes #7458

@gonidelis
gonidelis requested a review from a team as a code owner February 3, 2026 15:45
@gonidelis
gonidelis requested a review from pauleonix February 3, 2026 15:45
@github-project-automation github-project-automation Bot moved this to Todo in CCCL Feb 3, 2026
@cccl-authenticator-app cccl-authenticator-app Bot moved this from Todo to In Review in CCCL Feb 3, 2026
@github-actions

This comment has been minimized.

Comment thread cub/cub/device/device_partition.cuh Resolved
Comment thread cub/cub/device/device_partition.cuh Resolved
Comment thread cub/cub/device/device_partition.cuh Resolved
Comment thread cub/cub/device/device_partition.cuh Resolved

@bernhardmgruber bernhardmgruber left a comment •

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.

Also for this PR, if determinism does not make sense for DevicePartition I would remove all code related to it.

Does determinism mean stable here? And if it would, do we have stable and unstable versions of the algorithm?

@github-actions

This comment has been minimized.

Comment thread cub/cub/device/device_partition.cuh Outdated
Comment on lines +374 to +375
return partition_impl<tuning_t, InputIteratorT, FlagIterator, OutputIteratorT, NumSelectedIteratorT, NullType, offset_t>(
storage, bytes, d_in, d_flags, d_out, d_num_selected_out, static_cast<offset_t>(num_items), NullType{}, stream);

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.

Suggestion: let the compiler do the work for you:

Suggested change
return partition_impl<tuning_t, InputIteratorT, FlagIterator, OutputIteratorT, NumSelectedIteratorT, NullType, offset_t>(
storage, bytes, d_in, d_flags, d_out, d_num_selected_out, static_cast<offset_t>(num_items), NullType{}, stream);
return partition_impl<tuning_t>(
storage, bytes, d_in, d_flags, d_out, d_num_selected_out, static_cast<offset_t>(num_items), NullType{}, stream);

Comment thread cub/cub/device/device_partition.cuh Outdated
Comment on lines +630 to +632
return partition_impl<tuning_t, InputIteratorT, NullType*, OutputIteratorT, NumSelectedIteratorT, SelectOp, offset_t>(
storage, bytes, d_in, nullptr, d_out, d_num_selected_out, static_cast<offset_t>(num_items), select_op, stream);
});

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.

Suggested change
return partition_impl<tuning_t, InputIteratorT, NullType*, OutputIteratorT, NumSelectedIteratorT, SelectOp, offset_t>(
storage, bytes, d_in, nullptr, d_out, d_num_selected_out, static_cast<offset_t>(num_items), select_op, stream);
});
return partition_impl<tuning_t>(
storage, bytes, d_in, nullptr, d_out, d_num_selected_out, static_cast<offset_t>(num_items), select_op, stream);
});

@github-actions

This comment has been minimized.

@github-actions

Copy link
Copy Markdown
Contributor

🥳 CI Workflow Results

🟩 Finished in 5h 14m: Pass: 100%/99 | Total: 3d 04h | Max: 5h 14m | Hits: 96%/113302

See results here.

davebayer pushed a commit that referenced this pull request May 13, 2026
The env-overloads in cub::DevicePartition used unsigned offset types, while the non-env-overloads used signed ones. This was presumably an oversight in #7459.

Fixes: #8968
wmaxey pushed a commit that referenced this pull request May 21, 2026
…8976)

The env-overloads in cub::DevicePartition used unsigned offset types, while the non-env-overloads used signed ones. This was presumably an oversight in #7459.

Fixes: #8968
(cherry picked from commit e15d87a)

Co-authored-by: Bernhard Manfred Gruber <[email protected]>
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.

Add env-based API for cub::DevicePartition

4 participants