Skip to content

cuda.compute: Add select algorithm based on three_way_partition#6766

Merged
shwina merged 4 commits intoNVIDIA:mainfrom
shwina:add-select-with-three-way-partition
Nov 25, 2025
Merged

cuda.compute: Add select algorithm based on three_way_partition#6766
shwina merged 4 commits intoNVIDIA:mainfrom
shwina:add-select-with-three-way-partition

Conversation

@shwina
Copy link
Contributor

@shwina shwina commented Nov 24, 2025

Description

This PR adds an implementation of select that is based on three_way_partition. Longer term, we want to bind directly to cub::DeviceSelect.

It works by simply discarding the unselected portions of three_way_partition. As part of this PR, I needed to add a fix to DiscardIterator, which always defaulted to using a value type of uint8. This doesn't always work, as the value type must match the expected output type depending on the algorithm. Especially for struct types, no implicit conversion is usually possible so it must be explicitly provided.

Checklist

  • New or existing tests cover these changes.
  • The documentation is up to date with these changes.

@shwina shwina requested review from a team as code owners November 24, 2025 18:39
@github-project-automation github-project-automation bot moved this to Todo in CCCL Nov 24, 2025
@cccl-authenticator-app cccl-authenticator-app bot moved this from Todo to In Review in CCCL Nov 24, 2025
Copy link
Contributor

@NaderAlAwar NaderAlAwar left a comment

Choose a reason for hiding this comment

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

Approved with the expectation that we will replace this when we port select_if to cuda.compute

@github-actions
Copy link
Contributor

🥳 CI Workflow Results

🟩 Finished in 1h 27m: Pass: 100%/48 | Total: 15h 01m | Max: 51m 06s

See results here.

@shwina shwina merged commit 0015806 into NVIDIA:main Nov 25, 2025
61 of 62 checks passed
@github-project-automation github-project-automation bot moved this from In Review to Done in CCCL Nov 25, 2025
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