Skip to content

[REVIEW] Move from thrust::make_counting_iterator to cuda::make_counting_iterator#1826

Merged
rapids-bot[bot] merged 5 commits intorapidsai:mainfrom
mythrocks:thrust-counting-iterator
Feb 23, 2026
Merged

[REVIEW] Move from thrust::make_counting_iterator to cuda::make_counting_iterator#1826
rapids-bot[bot] merged 5 commits intorapidsai:mainfrom
mythrocks:thrust-counting-iterator

Conversation

@mythrocks
Copy link
Copy Markdown
Contributor

@mythrocks mythrocks commented Feb 19, 2026

This commit moves the use of thrust::make_counting_iterator to cuda::make_counting_iterator, much like in rapidsai/raft#2958.

This change was initally done to fix the compile error one saw because of the use of thrust::make_counting_iterator:

 │ │ $SRC_DIR/cpp/tests/neighbors/all_neighbors/../../../src/neighbors/detail/knn_brute_force.cuh(230): error: namespace "thrust" has no member "make_counting_iterator"
 │ │         auto count = thrust::make_counting_iterator<IndexType>(0);
 │ │                              ^
 │ │ $SRC_DIR/cpp/tests/neighbors/all_neighbors/../../../src/neighbors/detail/knn_brute_force.cuh(230): error: type name is not allowed
 │ │         auto count = thrust::make_counting_iterator<IndexType>(0);

The RAPIDS projects seem to be moving away from using the thrust function, and switching to the cuda version of the same. (Refer to rapidsai/raft#2958.) This change moves cuVS in that direction.

This commit fixes the compile error one sees because of the use
of `thrust::make_counting_iterator`:
```
│ │ $SRC_DIR/cpp/tests/neighbors/all_neighbors/../../../src/neighbors/detail/knn_brute_force.cuh(230): error: namespace "thrust" has no member "make_counting_iterator"
 │ │         auto count = thrust::make_counting_iterator<IndexType>(0);
 │ │                              ^
 │ │ $SRC_DIR/cpp/tests/neighbors/all_neighbors/../../../src/neighbors/detail/knn_brute_force.cuh(230): error: type name is not allowed
 │ │         auto count = thrust::make_counting_iterator<IndexType>(0);
```

The RAPIDS projects seem to be moving away from using the thrust function, and switching
to the cuda version of the same.  This change moves cuVS in that direction.

Signed-off-by: MithunR <mithunr@nvidia.com>
@mythrocks mythrocks requested a review from a team as a code owner February 19, 2026 23:28
@mythrocks mythrocks self-assigned this Feb 19, 2026
@mythrocks mythrocks added bug Something isn't working non-breaking Introduces a non-breaking change C++ labels Feb 19, 2026
@mythrocks mythrocks changed the title Fix compile error from thrust::make_counting_iterator [REVIEW] Fix compile error from thrust::make_counting_iterator Feb 19, 2026
@mythrocks mythrocks mentioned this pull request Feb 19, 2026
@mythrocks mythrocks changed the title [REVIEW] Fix compile error from thrust::make_counting_iterator [REVIEW] Move from thrust::make_counting_iterator to cuda::make_counting_iterator Feb 20, 2026
Copy link
Copy Markdown
Contributor

@jinsolp jinsolp left a comment

Choose a reason for hiding this comment

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

LGTM

@copy-pr-bot
Copy link
Copy Markdown

copy-pr-bot bot commented Feb 20, 2026

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@mythrocks
Copy link
Copy Markdown
Contributor Author

/ok to test dae9f7a

Copy link
Copy Markdown
Member

@divyegala divyegala left a comment

Choose a reason for hiding this comment

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

Can you do a more comprehensive update across the codebase please? https://github.com/search?q=repo%3Arapidsai%2Fcuvs%20counting_iterator&type=code

Signed-off-by: MithunR <mithunr@nvidia.com>
Signed-off-by: MithunR <mithunr@nvidia.com>
@mythrocks
Copy link
Copy Markdown
Contributor Author

/ok to test 88cc38a

@mythrocks
Copy link
Copy Markdown
Contributor Author

Can you do a more comprehensive update across the codebase please? https://github.com/search?q=repo%3Arapidsai%2Fcuvs%20counting_iterator&type=code

Yep. bc2e98b, and 4b252cc.

@aamijar
Copy link
Copy Markdown
Member

aamijar commented Feb 23, 2026

/merge

@rapids-bot rapids-bot bot merged commit 95051ba into rapidsai:main Feb 23, 2026
149 of 151 checks passed
tfeher pushed a commit to Stardust-SJF/cuvs_rabitq that referenced this pull request Mar 3, 2026
…unting_iterator` (rapidsai#1826)

This commit moves the use of `thrust::make_counting_iterator` to `cuda::make_counting_iterator`, much like in rapidsai/raft#2958.

This change was initally done to fix the compile error one saw because of the use of `thrust::make_counting_iterator`:
```
 │ │ $SRC_DIR/cpp/tests/neighbors/all_neighbors/../../../src/neighbors/detail/knn_brute_force.cuh(230): error: namespace "thrust" has no member "make_counting_iterator"
 │ │         auto count = thrust::make_counting_iterator<IndexType>(0);
 │ │                              ^
 │ │ $SRC_DIR/cpp/tests/neighbors/all_neighbors/../../../src/neighbors/detail/knn_brute_force.cuh(230): error: type name is not allowed
 │ │         auto count = thrust::make_counting_iterator<IndexType>(0);
```

The RAPIDS projects seem to be moving away from using the thrust function, and switching to the cuda version of the same. (Refer to rapidsai/raft#2958.) This change moves cuVS in that direction.

Authors:
  - MithunR (https://github.com/mythrocks)

Approvers:
  - Jinsol Park (https://github.com/jinsolp)
  - Divye Gala (https://github.com/divyegala)

URL: rapidsai#1826
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working C++ non-breaking Introduces a non-breaking change

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

4 participants