Skip to content

Replace uses of thrust::pair with cuda::std::pair - #6616

Merged
bernhardmgruber merged 4 commits into
NVIDIA:mainfrom
miscco:drop_thrust_pair
Nov 13, 2025
Merged

bernhardmgruber merged 4 commits into
NVIDIA:mainfrom
miscco:drop_thrust_pair

Conversation

@miscco

@miscco miscco commented Nov 13, 2025

Copy link
Copy Markdown
Contributor

Its an alias anyhow, so just use the right thing

Older GCC warn about unused variables with `if constexpr` if the variable is only used in one of the branches.

Avoid this by marking the variable as `[[maybe_unused]]`
Its an alias anyhow, so just use the right thing
@miscco
miscco requested review from a team as code owners November 13, 2025 09:04
@miscco
miscco requested a review from gonidelis November 13, 2025 09:04
@miscco
miscco requested a review from ericniebler November 13, 2025 09:04
@github-project-automation github-project-automation Bot moved this to Todo in CCCL Nov 13, 2025
@cccl-authenticator-app cccl-authenticator-app Bot moved this from Todo to In Review in CCCL Nov 13, 2025

@bernhardmgruber bernhardmgruber left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Great idea to refactor this! A few nits:

Comment thread thrust/thrust/set_operations.h Resolved
Comment thread thrust/thrust/unique.h Resolved
@github-actions

Copy link
Copy Markdown
Contributor

🥳 CI Workflow Results

🟩 Finished in 4h 57m: Pass: 100%/175 | Total: 7d 15h | Max: 4h 55m | Hits: 76%/358834

See results here.

@bernhardmgruber
bernhardmgruber merged commit 91434d7 into NVIDIA:main Nov 13, 2025
188 checks passed
@github-project-automation github-project-automation Bot moved this from In Review to Done in CCCL Nov 13, 2025
oleksandr-pavlyk added a commit to oleksandr-pavlyk/pytorch that referenced this pull request Nov 30, 2025
A change like NVIDIA/cccl#6616 may break
implicit transitive dependency resulting in build break due to type
thrust::pair being undefined, as happened in CCCL:

https://github.com/NVIDIA/cccl/actions/runs/19802695165/job/56732283408?pr=6712
pytorch-bot Bot pushed a commit to pytorch/pytorch that referenced this pull request Mar 11, 2026
A change like NVIDIA/cccl#6616 may break
implicit transitive dependency resulting in build break due to type
thrust::pair being undefined, as happened in CCCL:

https://github.com/NVIDIA/cccl/actions/runs/19802695165/job/56732283408?pr=6712
pytorchmergebot pushed a commit to oleksandr-pavlyk/pytorch that referenced this pull request Mar 11, 2026
A change like NVIDIA/cccl#6616 may break
implicit transitive dependency resulting in build break due to type
thrust::pair being undefined, as happened in CCCL:

https://github.com/NVIDIA/cccl/actions/runs/19802695165/job/56732283408?pr=6712
smalltalkman pushed a commit to smalltalkman/pytorch that referenced this pull request Mar 11, 2026
EmanueleCoradin pushed a commit to EmanueleCoradin/pytorch that referenced this pull request Mar 30, 2026
@miscco
miscco deleted the drop_thrust_pair branch May 12, 2026 14:41
gplutop7 pushed a commit to gplutop7/pytorch that referenced this pull request Jul 15, 2026
Naraenda pushed a commit to ROCm/rocm-libraries that referenced this pull request Oct 26, 2026
…r` with `cuda::std::pair` (NVIDIA/cccl#6616)

Upstream: NVIDIA/cccl@91434d7

HIP counterpart (system/hip): none; system/hip keeps thrust::pair. Ported only system/cuda (extrema, merge, mismatch, partition, reduce_by_key, set_operations, temporary_buffer, unique_by_key) and CUDA-only testing/cuda tests, where thrust::pair is an alias of cuda::std::pair. Generic/public headers, sequential/omp/tbb backends, top-level tests, examples and benchmarks keep thrust::pair: in the non-libhipcxx fallback thrust::pair is a distinct struct (pair.h), so switching signatures to _THRUST_STD::pair (std::pair) would break the fallback and diverge from system/hip return types (compatibility over upstream parity). Remaining upstream changes in those files were formatting-only. test/ counterpart: none (test/ uses thrust::pair; unchanged). Not compiled, tests not run (per human)

Co-Authored-By: Claude <noreply@anthropic.com>
amd-jmahovsky added a commit to ROCm/rocm-libraries that referenced this pull request Oct 28, 2026
…T_STD::pair

Related upstream commit: 91434d76ab3 Replace uses of `thrust::pair` with `cuda::std::pair` (NVIDIA/cccl#6616)
Related local port commit: 7bace77

The port only switched system/cuda and testing/cuda, keeping thrust::pair
in generic/public headers, the sequential/omp/tbb backends, system/hip,
tests and examples because thrust::pair was a distinct struct in the
non-libhipcxx fallback. libhipcxx is now mandatory and thrust::pair is
just an alias of _THRUST_STD::pair, so the remaining files follow upstream:
- thrust::pair / unqualified pair / thrust::make_pair ->
  _THRUST_STD::pair / _THRUST_STD::make_pair in every non-cuda header,
  test and example touched by upstream (including doxygen snippets),
  plus testing/binary_search.cu and testing/transform.cu (upstream's
  catch2_test_binary_search.cu / catch2_test_transform.cu).
- system/hip/detail (extrema, merge, mismatch, partition, reduce_by_key,
  set_operations, temporary_buffer, unique_by_key) gets the same spelling
  as its system/cuda counterpart, so hip tracks upstream.
- #include <thrust/pair.h> is replaced with
  _THRUST_STD_INCLUDE(__utility/pair.h) (headers) or
  _THRUST_STD_INCLUDE(utility) (tests/examples) where upstream did so,
  or dropped where upstream dropped it.
testing/pair.cu (tests thrust::pair itself), test/ and benchmark/ keep
thrust::pair, which remains a public alias.

Not compiled, tests not run (per human)

Co-Authored-By: Claude <noreply@anthropic.com>
Naraenda pushed a commit to ROCm/rocm-libraries that referenced this pull request Oct 29, 2026
…r` with `cuda::std::pair` (NVIDIA/cccl#6616)

Upstream: NVIDIA/cccl@91434d7

HIP counterpart (system/hip): none; system/hip keeps thrust::pair. Ported only system/cuda (extrema, merge, mismatch, partition, reduce_by_key, set_operations, temporary_buffer, unique_by_key) and CUDA-only testing/cuda tests, where thrust::pair is an alias of cuda::std::pair. Generic/public headers, sequential/omp/tbb backends, top-level tests, examples and benchmarks keep thrust::pair: in the non-libhipcxx fallback thrust::pair is a distinct struct (pair.h), so switching signatures to _THRUST_STD::pair (std::pair) would break the fallback and diverge from system/hip return types (compatibility over upstream parity). Remaining upstream changes in those files were formatting-only. test/ counterpart: none (test/ uses thrust::pair; unchanged). Not compiled, tests not run (per human)

Co-Authored-By: Claude <noreply@anthropic.com>
Naraenda pushed a commit to ROCm/rocm-libraries that referenced this pull request Oct 29, 2026
…r` with `cuda::std::pair` (NVIDIA/cccl#6616)

Upstream: NVIDIA/cccl@91434d7

HIP counterpart (system/hip): none; system/hip keeps thrust::pair. Ported only system/cuda (extrema, merge, mismatch, partition, reduce_by_key, set_operations, temporary_buffer, unique_by_key) and CUDA-only testing/cuda tests, where thrust::pair is an alias of cuda::std::pair. Generic/public headers, sequential/omp/tbb backends, top-level tests, examples and benchmarks keep thrust::pair: in the non-libhipcxx fallback thrust::pair is a distinct struct (pair.h), so switching signatures to _THRUST_STD::pair (std::pair) would break the fallback and diverge from system/hip return types (compatibility over upstream parity). Remaining upstream changes in those files were formatting-only. test/ counterpart: none (test/ uses thrust::pair; unchanged). Not compiled, tests not run (per human)

Co-Authored-By: Claude <noreply@anthropic.com>
Naraenda pushed a commit to ROCm/rocm-libraries that referenced this pull request Oct 29, 2026
…T_STD::pair

Related upstream commit: 91434d76ab3 Replace uses of `thrust::pair` with `cuda::std::pair` (NVIDIA/cccl#6616)
Related local port commit: 7bace77

The port only switched system/cuda and testing/cuda, keeping thrust::pair
in generic/public headers, the sequential/omp/tbb backends, system/hip,
tests and examples because thrust::pair was a distinct struct in the
non-libhipcxx fallback. libhipcxx is now mandatory and thrust::pair is
just an alias of _THRUST_STD::pair, so the remaining files follow upstream:
- thrust::pair / unqualified pair / thrust::make_pair ->
  _THRUST_STD::pair / _THRUST_STD::make_pair in every non-cuda header,
  test and example touched by upstream (including doxygen snippets),
  plus testing/binary_search.cu and testing/transform.cu (upstream's
  catch2_test_binary_search.cu / catch2_test_transform.cu).
- system/hip/detail (extrema, merge, mismatch, partition, reduce_by_key,
  set_operations, temporary_buffer, unique_by_key) gets the same spelling
  as its system/cuda counterpart, so hip tracks upstream.
- #include <thrust/pair.h> is replaced with
  _THRUST_STD_INCLUDE(__utility/pair.h) (headers) or
  _THRUST_STD_INCLUDE(utility) (tests/examples) where upstream did so,
  or dropped where upstream dropped it.
testing/pair.cu (tests thrust::pair itself), test/ and benchmark/ keep
thrust::pair, which remains a public alias.

Not compiled, tests not run (per human)

Co-Authored-By: Claude <noreply@anthropic.com>
Naraenda pushed a commit to ROCm/rocm-libraries that referenced this pull request Oct 30, 2026
…r` with `cuda::std::pair` (NVIDIA/cccl#6616)

Upstream: NVIDIA/cccl@91434d7

HIP counterpart (system/hip): none; system/hip keeps thrust::pair. Ported only system/cuda (extrema, merge, mismatch, partition, reduce_by_key, set_operations, temporary_buffer, unique_by_key) and CUDA-only testing/cuda tests, where thrust::pair is an alias of cuda::std::pair. Generic/public headers, sequential/omp/tbb backends, top-level tests, examples and benchmarks keep thrust::pair: in the non-libhipcxx fallback thrust::pair is a distinct struct (pair.h), so switching signatures to _THRUST_STD::pair (std::pair) would break the fallback and diverge from system/hip return types (compatibility over upstream parity). Remaining upstream changes in those files were formatting-only. test/ counterpart: none (test/ uses thrust::pair; unchanged). Not compiled, tests not run (per human)

Co-Authored-By: Claude <noreply@anthropic.com>
Beanavil pushed a commit to ROCm/rocm-libraries that referenced this pull request Oct 30, 2026
…r` with `cuda::std::pair` (NVIDIA/cccl#6616)

Upstream: NVIDIA/cccl@91434d7

HIP counterpart (system/hip): none; system/hip keeps thrust::pair. Ported only system/cuda (extrema, merge, mismatch, partition, reduce_by_key, set_operations, temporary_buffer, unique_by_key) and CUDA-only testing/cuda tests, where thrust::pair is an alias of cuda::std::pair. Generic/public headers, sequential/omp/tbb backends, top-level tests, examples and benchmarks keep thrust::pair: in the non-libhipcxx fallback thrust::pair is a distinct struct (pair.h), so switching signatures to _THRUST_STD::pair (std::pair) would break the fallback and diverge from system/hip return types (compatibility over upstream parity). Remaining upstream changes in those files were formatting-only. test/ counterpart: none (test/ uses thrust::pair; unchanged). Not compiled, tests not run (per human)

Co-Authored-By: Claude <noreply@anthropic.com>
amd-jmahovsky added a commit to ROCm/rocm-libraries that referenced this pull request Oct 30, 2026
…T_STD::pair

Related upstream commit: 91434d76ab3 Replace uses of `thrust::pair` with `cuda::std::pair` (NVIDIA/cccl#6616)
Related local port commit: 7bace77

The port only switched system/cuda and testing/cuda, keeping thrust::pair
in generic/public headers, the sequential/omp/tbb backends, system/hip,
tests and examples because thrust::pair was a distinct struct in the
non-libhipcxx fallback. libhipcxx is now mandatory and thrust::pair is
just an alias of _THRUST_STD::pair, so the remaining files follow upstream:
- thrust::pair / unqualified pair / thrust::make_pair ->
  _THRUST_STD::pair / _THRUST_STD::make_pair in every non-cuda header,
  test and example touched by upstream (including doxygen snippets),
  plus testing/binary_search.cu and testing/transform.cu (upstream's
  catch2_test_binary_search.cu / catch2_test_transform.cu).
- system/hip/detail (extrema, merge, mismatch, partition, reduce_by_key,
  set_operations, temporary_buffer, unique_by_key) gets the same spelling
  as its system/cuda counterpart, so hip tracks upstream.
- #include <thrust/pair.h> is replaced with
  _THRUST_STD_INCLUDE(__utility/pair.h) (headers) or
  _THRUST_STD_INCLUDE(utility) (tests/examples) where upstream did so,
  or dropped where upstream dropped it.
testing/pair.cu (tests thrust::pair itself), test/ and benchmark/ keep
thrust::pair, which remains a public alias.

Not compiled, tests not run (per human)

Co-Authored-By: Claude <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

3 participants