Skip to content

Drop usage of thrust iterators#2254

Merged
rapids-bot[bot] merged 2 commits intorapidsai:mainfrom
miscco:drop_thrust_iterator
Feb 16, 2026
Merged

Drop usage of thrust iterators#2254
rapids-bot[bot] merged 2 commits intorapidsai:mainfrom
miscco:drop_thrust_iterator

Conversation

@miscco
Copy link
Copy Markdown
Contributor

@miscco miscco commented Feb 13, 2026

We can use the more modern cuda iterators instead

We can use the more modern cuda iterators instead
@miscco miscco requested a review from a team as a code owner February 13, 2026 14:56
@miscco miscco requested review from bdice and wence- February 13, 2026 14:56
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Feb 13, 2026

📝 Walkthrough

Summary by CodeRabbit

  • Refactor
    • Replaced internal iterator/iterator-utility implementations with CUDA-provided equivalents. No changes to public APIs or runtime behavior.
  • Chores
    • Updated copyright years and removed unused internal includes.

Walkthrough

Replaced Thrust iterator utilities with CUDA C++ iterator equivalents across benchmarks, headers, and tests; updated iterator type aliases in device_uvector to cuda::std::reverse_iterator; removed several rmm/detail/thrust_namespace.h includes and bumped copyright years.

Changes

Cohort / File(s) Summary
Benchmarks & Replay
cpp/benchmarks/replay/replay.cpp
Replaced thrust::make_constant_iterator / thrust::make_discard_iterator with cuda::make_constant_iterator / cuda::make_discard_iterator; added <cuda/iterator> include and removed Thrust iterator includes; copyright year updated.
Device uvector iterators
cpp/include/rmm/device_uvector.hpp
Switched reverse_iterator and const_reverse_iterator aliases from thrust::reverse_iterator<...> to cuda::std::reverse_iterator<...> and added the corresponding CUDA std iterator include. (Public type-alias resolution changed.)
Memory resource iterators
cpp/include/rmm/mr/fixed_size_memory_resource.hpp, cpp/include/rmm/mr/pool_memory_resource.hpp
Replaced Thrust counting/transform iterator usage with cuda::make_counting_iterator / cuda::make_transform_iterator and <cuda/iterator> include; removed Thrust iterator headers and rmm/detail/thrust_namespace.h include.
Tests (logger)
cpp/tests/logger_tests.cpp
Replaced thrust::make_zip_iterator and Thrust zip iterator include with cuda::make_zip_iterator and <cuda/iterator>; copyright year updated.
Async memory resource headers
cpp/include/rmm/mr/cuda_async_memory_resource.hpp, cpp/include/rmm/mr/cuda_async_managed_memory_resource.hpp, cpp/include/rmm/mr/cuda_async_view_memory_resource.hpp
Removed #include <rmm/detail/thrust_namespace.h> from headers; no other API or behavioral changes.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

🚥 Pre-merge checks | ✅ 3 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Merge Conflict Detection ⚠️ Warning ❌ Merge conflicts detected (9 files):

⚔️ cpp/benchmarks/replay/replay.cpp (content)
⚔️ cpp/include/rmm/device_uvector.hpp (content)
⚔️ cpp/include/rmm/mr/cuda_async_managed_memory_resource.hpp (content)
⚔️ cpp/include/rmm/mr/cuda_async_memory_resource.hpp (content)
⚔️ cpp/include/rmm/mr/cuda_async_view_memory_resource.hpp (content)
⚔️ cpp/include/rmm/mr/detail/stream_ordered_memory_resource.hpp (content)
⚔️ cpp/include/rmm/mr/fixed_size_memory_resource.hpp (content)
⚔️ cpp/include/rmm/mr/pool_memory_resource.hpp (content)
⚔️ cpp/tests/logger_tests.cpp (content)

These conflicts must be resolved before merging into main.
Resolve conflicts locally and push changes to this branch.
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title 'Drop usage of thrust iterators' directly and clearly describes the main objective of the changeset, which systematically replaces thrust iterators with CUDA equivalents across multiple files.
Description check ✅ Passed The description 'We can use the more modern cuda iterators instead' is directly related to the changeset, explaining the rationale for replacing thrust iterators with CUDA iterators.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
⚔️ Resolve merge conflicts (beta)
  • Auto-commit resolved conflicts to branch drop_thrust_iterator
  • Post resolved changes as copyable diffs in a comment

No actionable comments were generated in the recent review. 🎉


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🤖 Fix all issues with AI agents
In `@cpp/include/rmm/mr/fixed_size_memory_resource.hpp`:
- Line 17: Remove the now-unused include of <rmm/detail/thrust_namespace.h> from
cpp/include/rmm/mr/fixed_size_memory_resource.hpp (it was used previously for
Thrust iterator aliases but is no longer needed after switching to
<cuda/iterator> and cuda::make_transform_iterator /
cuda::make_counting_iterator); locate the `#include`
"<rmm/detail/thrust_namespace.h>" and delete that line and then verify no other
references to symbols from rmm::detail::thrust_namespace remain in the file
(e.g., usages around FixedSizeMemoryResource or related helper functions).

In `@cpp/tests/logger_tests.cpp`:
- Around line 99-102: The tests use the non-existent helper
cuda::make_zip_iterator; replace its usage by directly constructing
cuda::zip_iterator for the begin and end iterators so the compiler can find the
correct API. Specifically, update the creation of begin and end that currently
reference cuda::make_zip_iterator to construct cuda::zip_iterator objects using
expected_events.begin()/end() and actual_events.begin()/end() respectively (the
variables named begin and end and the containers expected_events and
actual_events). Ensure both begin and end use the direct cuda::zip_iterator
constructor syntax so the code compiles.

Copy link
Copy Markdown
Collaborator

@bdice bdice left a comment

Choose a reason for hiding this comment

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

@miscco If you don’t mind, please look at the CodeRabbit suggestions and comment on whether they are useful/true/false. If there are incorrect comments, I am interested in the “Analysis Chain” and where it is right or wrong. I’m refining the AI review prompts and I might need to give it more context on how to consult against CCCL.

@miscco miscco force-pushed the drop_thrust_iterator branch from 00079aa to 012a63a Compare February 14, 2026 11:24
@wence- wence- added the improvement Improvement / enhancement to an existing function label Feb 16, 2026
@bdice bdice added the non-breaking Non-breaking change label Feb 16, 2026
@bdice
Copy link
Copy Markdown
Collaborator

bdice commented Feb 16, 2026

/merge

@rapids-bot rapids-bot bot merged commit 6fc17d0 into rapidsai:main Feb 16, 2026
85 checks passed
@coderabbitai coderabbitai bot mentioned this pull request Mar 16, 2026
3 tasks
@coderabbitai coderabbitai bot mentioned this pull request Mar 31, 2026
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

improvement Improvement / enhancement to an existing function non-breaking Non-breaking change

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants