Repository navigation
Replace uses of thrust::pair with cuda::std::pair - #6616
Merged
Merged
Conversation
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
bernhardmgruber
approved these changes
Nov 13, 2025
bernhardmgruber
left a comment
Contributor
There was a problem hiding this comment.
Great idea to refactor this! A few nits:
miscco
force-pushed
the
drop_thrust_pair
branch
from
November 13, 2025 09:31
c4994df to
3cd33a0
Compare
bernhardmgruber
approved these changes
Nov 13, 2025
davebayer
approved these changes
Nov 13, 2025
Contributor
🥳 CI Workflow Results🟩 Finished in 4h 57m: Pass: 100%/175 | Total: 7d 15h | Max: 4h 55m | Hits: 76%/358834See results here. |
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
This was referenced Nov 30, 2025
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
…169267) 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 Fixes pytorch#169266 Pull Request resolved: pytorch#169267 Approved by: https://github.com/malfet, https://github.com/eqy
EmanueleCoradin
pushed a commit
to EmanueleCoradin/pytorch
that referenced
this pull request
Mar 30, 2026
…169267) 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 Fixes pytorch#169266 Pull Request resolved: pytorch#169267 Approved by: https://github.com/malfet, https://github.com/eqy
gplutop7
pushed a commit
to gplutop7/pytorch
that referenced
this pull request
Jul 15, 2026
…169267) 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 Fixes pytorch#169266 Pull Request resolved: pytorch#169267 Approved by: https://github.com/malfet, https://github.com/eqy
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>
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.
Its an alias anyhow, so just use the right thing