cub: change {Lower,Upper}Bound to accept iterator and number of elements.#7446
Open
griwes wants to merge 3 commits intoNVIDIA:mainfrom
Open
cub: change {Lower,Upper}Bound to accept iterator and number of elements.#7446griwes wants to merge 3 commits intoNVIDIA:mainfrom
griwes wants to merge 3 commits intoNVIDIA:mainfrom
Conversation
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
miscco
reviewed
Feb 2, 2026
|
|
||
| template <typename Mode, typename RangeIteratorT, typename CompareOpT> | ||
| _CCCL_HOST_DEVICE auto make_comp_wrapper(RangeIteratorT first, RangeIteratorT last, CompareOpT comp) | ||
| template <typename Mode, typename RangeIteratorT, typename RangeNumItemsT, typename CompareOpT> |
Contributor
There was a problem hiding this comment.
Blasphemeous question, why not have both interfaces and store distance(first, last) in the iterator based entry point?
Contributor
Author
There was a problem hiding this comment.
We require RAI, so this is straightforward for the user to do with just last - first.
Comment on lines
+201
to
+204
| ::cuda::make_zip_iterator(d_values, d_output), | ||
| static_cast<ValuesOffsetT>(values_num_items), | ||
| detail::find::make_comp_wrapper<detail::find::lower_bound>( | ||
| d_range, static_cast<RangeOffsetT>(range_num_items), comp), |
Contributor
There was a problem hiding this comment.
What if values_num_items is smaller than range_num_items?
Also we are using values_num_items in one place and range_num_items in the other
Contributor
Author
There was a problem hiding this comment.
Yes, those are two separate ranges, we're doing for each over values, and letting each thread know about the whole range of input elements.
This comment has been minimized.
This comment has been minimized.
Contributor
🥳 CI Workflow Results🟩 Finished in 10h 17m: Pass: 100%/104 | Total: 5d 13h | Max: 5h 54m | Hits: 57%/110171See results here. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Change the interface of
DeviceFind::{Lower,Upper}Boundfrom accepting pairs of iterators to accepting a begin iterator and item count, to be more consistent with most of the other interfaces in CUB.Resolves #7445.
Checklist