Repository navigation
Overload standard iterator functions for cuda iterators - #7738
Merged
Merged
Conversation
miscco
force-pushed
the
cuda_iterator_stl
branch
from
February 23, 2026 16:20
e494071 to
ca7ed11
Compare
miscco
force-pushed
the
cuda_iterator_stl
branch
from
February 23, 2026 16:33
ca7ed11 to
6e29bc3
Compare
cuda iteratorscuda iterators
miscco
force-pushed
the
cuda_iterator_stl
branch
from
February 23, 2026 17:58
6e29bc3 to
2fa52dc
Compare
Contributor
🥳 CI Workflow Results🟩 Finished in 1h 22m: Pass: 100%/99 | Total: 1d 06h | Max: 1h 05m | Hits: 89%/251637See results here. |
davebayer
approved these changes
Feb 23, 2026
miscco
added a commit
to miscco/cccl
that referenced
this pull request
Feb 26, 2026
* Overload standard iterator functions for `cuda::counting_iterator` * Overload standard iterator functions for `cuda::zip_iterator` * Overload standard iterator functions for `cuda::zip_transform_iterator` * Overload standard iterator functions for `cuda::transform_iterator` * Overload standard iterator functions for `cuda::transform_output_iterator` * Overload standard iterator functions for `cuda::transform_input_output_iterator`
wmaxey
added a commit
that referenced
this pull request
Feb 27, 2026
* Overload standard iterator functions for `cuda` iterators (#7738) * Overload standard iterator functions for `cuda::counting_iterator` * Overload standard iterator functions for `cuda::zip_iterator` * Overload standard iterator functions for `cuda::zip_transform_iterator` * Overload standard iterator functions for `cuda::transform_iterator` * Overload standard iterator functions for `cuda::transform_output_iterator` * Overload standard iterator functions for `cuda::transform_input_output_iterator` * Make `cuda::zip_iterator` work with proxy iterators (#7787) We have a lot of proxy iterators that might be valid targets for zip_iterator However, those conventionally have `void` as their `reference` / `value_type` In that case, there is no `iter_value_t` available, so we need to deduce it differently Fixes #7783 --------- Co-authored-by: Wesley Maxey <[email protected]>
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.
Our cuda iterators are modern C++20 style iterators
That means they are very versatile, but also that they conform to the C++20 iterator concepts and not the C++17 iterator categories.
This creates the issue that if a user calls e.g.
::std::distance(::cuda::counting_iterator, ::cuda::counting_iterator)that will take the slow increment until equal path, because::cuda::counting_iteratoris not a C++17 random_access_iterator.We already solve this issue in our own implementations through
__has_meow_traversal_vwhich looks both at theiterator_categoryand also if needed at theiterator_conceptA relatively simple solution is to provide overloads for the common
stditerator functionsstd::advance, ``std::distance,std::nextandstd::prevThat should help most use cases and with all the ranges machinery we are save anyway