Skip to content

Conversation

@shwina
Copy link
Contributor

@shwina shwina commented Jan 15, 2026

Description

Closes #6688.

This Python part of this PR is pretty standard. However, on the C side, I found the need to extend the binary search APIs to return indices rather than pointers. The cub::DeviceFind::Lower/UpperBound APIs follow C++ standard library semantics, returning an iterator representing the lower/upper bound positions, rather than indices. On the Python side, we want indices instead, similar to the vectorized versions thrust::lower_bound and thrust::upper_bound.

I couldn't make a TransformOutputIterator to make this work. I think this is because of an assumption that the output is always a pointer (not an iterator) here.

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 January 15, 2026 17:32
@github-project-automation github-project-automation bot moved this to Todo in CCCL Jan 15, 2026
@cccl-authenticator-app cccl-authenticator-app bot moved this from Todo to In Review in CCCL Jan 15, 2026
@shwina shwina force-pushed the cuda-compute-upper-lower-bound branch from f811fe7 to 9df692a Compare January 15, 2026 19:41
@shwina shwina changed the title Cuda compute upper lower bound Add cuda.compute APIs for upper_bound and lower_bound Jan 15, 2026
@github-actions

This comment has been minimized.

@alliepiper alliepiper removed their request for review January 15, 2026 21:58
@shwina shwina self-assigned this Jan 20, 2026
@shwina shwina force-pushed the cuda-compute-upper-lower-bound branch from 9df692a to 8fb23ad Compare January 21, 2026 14:55
@griwes
Copy link
Contributor

griwes commented Jan 22, 2026

See #7320 for a proper fix to the binary search return type issue.

@github-actions

This comment has been minimized.

@shwina shwina force-pushed the cuda-compute-upper-lower-bound branch from ead7bd1 to 74d7ae7 Compare January 22, 2026 21:07
@shwina shwina enabled auto-merge (squash) January 22, 2026 21:08
@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions
Copy link
Contributor

🥳 CI Workflow Results

🟩 Finished in 4h 22m: Pass: 100%/48 | Total: 16h 06m | Max: 55m 36s

See results here.

@shwina shwina merged commit e6d994e into NVIDIA:main Jan 23, 2026
181 of 187 checks passed
@github-project-automation github-project-automation bot moved this from In Review to Done in CCCL Jan 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

Provide lower_bound in cuda.compute

3 participants