Repository navigation
Cleanup includes in thrust - #6547
Merged
Merged
Conversation
This comment has been minimized.
This comment has been minimized.
We only want to include what we need not the whole world There are multiple cases where we only needed cuda::std::declval but included all of cuda::std::utility which is in the order of 100k LoC
miscco
force-pushed
the
thrust_includes
branch
from
November 7, 2025 16:51
3de1ccf to
734f8fc
Compare
Contributor
🥳 CI Workflow Results🟩 Finished in 2h 39m: Pass: 100%/72 | Total: 2d 02h | Max: 2h 33m | Hits: 83%/115552See results here. |
bernhardmgruber
approved these changes
Nov 8, 2025
Contributor
|
This PR isn't playing nicely with #6546: https://github.com/NVIDIA/cccl/actions/runs/19197936275/job/54881673252 |
Contributor
|
@alliepiper I think this should be addressed by: #6563. Thx for pointing this out! |
Naraenda
pushed a commit
to ROCm/rocm-libraries
that referenced
this pull request
Oct 26, 2026
…VIDIA/cccl#6547) Upstream: NVIDIA/cccl@4b10fd2 HIP counterpart (system/hip): none needed; system/cuda include cleanup taken as upstream. Generic headers: took trait modernization (is_x_v, enable_if_t, add_lvalue_reference_t) and binary_search_less -> _THRUST_STD::less<> (added _THRUST_STD_INCLUDE(functional)); kept local include blocks instead of upstream's granular libcu++-internal includes (would break non-libhipcxx builds); kept ::internal::is_integral/::internal::If wrappers and dual less list in cuda sort.h. test/ counterpart: none. 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
…cludes Related upstream commit: 4b10fd26255 Cleanup includes in thrust (NVIDIA/cccl#6547) Related local port commit: ed71224 The port kept the ::internal::is_integral / ::internal::If wrappers, the local umbrella include blocks and the dual less/greater list in cuda sort.h because of non-libhipcxx builds. libhipcxx is now mandatory, so: - ::internal::is_integral(_v) -> _THRUST_STD::is_integral(_v) in detail/type_traits.h, detail/vector_base.inl and counting_iterator.h (is_integral_v in distance_to, as upstream); the now-unused ::internal::is_integral/is_integral_v aliases are removed. - ::internal::If -> _THRUST_STD::_If (as upstream) in counting_iterator.h, iterator_adaptor_base.h, iterator_category_to_traversal.h, generic/reduce_by_key.inl and hip/detail/reduce_by_key.h; the libcxx_wrapper conditional.h includes are replaced by _THRUST_STD_INCLUDE(__type_traits/conditional.h). (The wrapper file itself stays because the dead fallback branch of the construct_at wrapper still includes it.) - counting_iterator.h and iterator_adaptor_base.h take the upstream granular __type_traits includes (drops the rocprim/type_traits.hpp fallback); minimum_system.h and iterator_category_to_traversal.h drop the type_traits includes as upstream. - cuda sort.h: can_use_primitive_sort uses the upstream is_same_v list without the duplicated _THRUST_STD:: comparators (_THRUST_STD is ::cuda::std there). thrust/detail/type_traits.h keeps its _THRUST_STD_INCLUDE(type_traits) umbrella; switching it to upstream's granular list would require the upstream include fixups in ~100 other headers. 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
…VIDIA/cccl#6547) Upstream: NVIDIA/cccl@4b10fd2 HIP counterpart (system/hip): none needed; system/cuda include cleanup taken as upstream. Generic headers: took trait modernization (is_x_v, enable_if_t, add_lvalue_reference_t) and binary_search_less -> _THRUST_STD::less<> (added _THRUST_STD_INCLUDE(functional)); kept local include blocks instead of upstream's granular libcu++-internal includes (would break non-libhipcxx builds); kept ::internal::is_integral/::internal::If wrappers and dual less list in cuda sort.h. test/ counterpart: none. 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
…VIDIA/cccl#6547) Upstream: NVIDIA/cccl@4b10fd2 HIP counterpart (system/hip): none needed; system/cuda include cleanup taken as upstream. Generic headers: took trait modernization (is_x_v, enable_if_t, add_lvalue_reference_t) and binary_search_less -> _THRUST_STD::less<> (added _THRUST_STD_INCLUDE(functional)); kept local include blocks instead of upstream's granular libcu++-internal includes (would break non-libhipcxx builds); kept ::internal::is_integral/::internal::If wrappers and dual less list in cuda sort.h. test/ counterpart: none. 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
…cludes Related upstream commit: 4b10fd26255 Cleanup includes in thrust (NVIDIA/cccl#6547) Related local port commit: ed71224 The port kept the ::internal::is_integral / ::internal::If wrappers, the local umbrella include blocks and the dual less/greater list in cuda sort.h because of non-libhipcxx builds. libhipcxx is now mandatory, so: - ::internal::is_integral(_v) -> _THRUST_STD::is_integral(_v) in detail/type_traits.h, detail/vector_base.inl and counting_iterator.h (is_integral_v in distance_to, as upstream); the now-unused ::internal::is_integral/is_integral_v aliases are removed. - ::internal::If -> _THRUST_STD::_If (as upstream) in counting_iterator.h, iterator_adaptor_base.h, iterator_category_to_traversal.h, generic/reduce_by_key.inl and hip/detail/reduce_by_key.h; the libcxx_wrapper conditional.h includes are replaced by _THRUST_STD_INCLUDE(__type_traits/conditional.h). (The wrapper file itself stays because the dead fallback branch of the construct_at wrapper still includes it.) - counting_iterator.h and iterator_adaptor_base.h take the upstream granular __type_traits includes (drops the rocprim/type_traits.hpp fallback); minimum_system.h and iterator_category_to_traversal.h drop the type_traits includes as upstream. - cuda sort.h: can_use_primitive_sort uses the upstream is_same_v list without the duplicated _THRUST_STD:: comparators (_THRUST_STD is ::cuda::std there). thrust/detail/type_traits.h keeps its _THRUST_STD_INCLUDE(type_traits) umbrella; switching it to upstream's granular list would require the upstream include fixups in ~100 other headers. 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 29, 2026
… cleanup Related upstream commit: 4b10fd26255 Cleanup includes in thrust (NVIDIA/cccl#6547) Related local port commit: ee821be Bring the include structure of thrust/ in line with upstream v3.2.1 now that libhipcxx is mandatory: - Apply the upstream granular libcu++ include regions to the files touched by #6547 (umbrella <cuda/std/X> headers replaced by __X/*.h headers). - Remove the ::internal:: type-trait aliases from detail/type_traits.h and use _THRUST_STD:: directly, matching upstream. - Drop dead !_THRUST_HAS_DEVICE_SYSTEM_STD fallback code (thrust::swap fallback, aligned_storage_size fallback, actor argument variant, raw_reference_cast apply branch, iter_swap/swap_ranges fallbacks). - Replace umbrella includes in the hip backend with granular headers and add direct includes for libcu++ symbols used by hip backend files. Local adaptations kept: thrust/detail/memory_wrapper.h, __host_stdlib/ stdexcept, hip hints in #if 0 blocks, THRUST_COMPILER(NVRTC), _CCCL_CUDA_COMPILATION(), the [NON-CCCL PARITY] cstddef include in type_traits.h, erfcinv includes, and the find.h tuple umbrella. The libcxx_wrapper directory and tests are left for a separate effort. 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
…VIDIA/cccl#6547) Upstream: NVIDIA/cccl@4b10fd2 HIP counterpart (system/hip): none needed; system/cuda include cleanup taken as upstream. Generic headers: took trait modernization (is_x_v, enable_if_t, add_lvalue_reference_t) and binary_search_less -> _THRUST_STD::less<> (added _THRUST_STD_INCLUDE(functional)); kept local include blocks instead of upstream's granular libcu++-internal includes (would break non-libhipcxx builds); kept ::internal::is_integral/::internal::If wrappers and dual less list in cuda sort.h. test/ counterpart: none. 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
…VIDIA/cccl#6547) Upstream: NVIDIA/cccl@4b10fd2 HIP counterpart (system/hip): none needed; system/cuda include cleanup taken as upstream. Generic headers: took trait modernization (is_x_v, enable_if_t, add_lvalue_reference_t) and binary_search_less -> _THRUST_STD::less<> (added _THRUST_STD_INCLUDE(functional)); kept local include blocks instead of upstream's granular libcu++-internal includes (would break non-libhipcxx builds); kept ::internal::is_integral/::internal::If wrappers and dual less list in cuda sort.h. test/ counterpart: none. 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
…cludes Related upstream commit: 4b10fd26255 Cleanup includes in thrust (NVIDIA/cccl#6547) Related local port commit: ed71224 The port kept the ::internal::is_integral / ::internal::If wrappers, the local umbrella include blocks and the dual less/greater list in cuda sort.h because of non-libhipcxx builds. libhipcxx is now mandatory, so: - ::internal::is_integral(_v) -> _THRUST_STD::is_integral(_v) in detail/type_traits.h, detail/vector_base.inl and counting_iterator.h (is_integral_v in distance_to, as upstream); the now-unused ::internal::is_integral/is_integral_v aliases are removed. - ::internal::If -> _THRUST_STD::_If (as upstream) in counting_iterator.h, iterator_adaptor_base.h, iterator_category_to_traversal.h, generic/reduce_by_key.inl and hip/detail/reduce_by_key.h; the libcxx_wrapper conditional.h includes are replaced by _THRUST_STD_INCLUDE(__type_traits/conditional.h). (The wrapper file itself stays because the dead fallback branch of the construct_at wrapper still includes it.) - counting_iterator.h and iterator_adaptor_base.h take the upstream granular __type_traits includes (drops the rocprim/type_traits.hpp fallback); minimum_system.h and iterator_category_to_traversal.h drop the type_traits includes as upstream. - cuda sort.h: can_use_primitive_sort uses the upstream is_same_v list without the duplicated _THRUST_STD:: comparators (_THRUST_STD is ::cuda::std there). thrust/detail/type_traits.h keeps its _THRUST_STD_INCLUDE(type_traits) umbrella; switching it to upstream's granular list would require the upstream include fixups in ~100 other headers. 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
… cleanup Related upstream commit: 4b10fd26255 Cleanup includes in thrust (NVIDIA/cccl#6547) Related local port commit: ee821be Bring the include structure of thrust/ in line with upstream v3.2.1 now that libhipcxx is mandatory: - Apply the upstream granular libcu++ include regions to the files touched by #6547 (umbrella <cuda/std/X> headers replaced by __X/*.h headers). - Remove the ::internal:: type-trait aliases from detail/type_traits.h and use _THRUST_STD:: directly, matching upstream. - Drop dead !_THRUST_HAS_DEVICE_SYSTEM_STD fallback code (thrust::swap fallback, aligned_storage_size fallback, actor argument variant, raw_reference_cast apply branch, iter_swap/swap_ranges fallbacks). - Replace umbrella includes in the hip backend with granular headers and add direct includes for libcu++ symbols used by hip backend files. Local adaptations kept: thrust/detail/memory_wrapper.h, __host_stdlib/ stdexcept, hip hints in #if 0 blocks, THRUST_COMPILER(NVRTC), _CCCL_CUDA_COMPILATION(), the [NON-CCCL PARITY] cstddef include in type_traits.h, erfcinv includes, and the find.h tuple umbrella. The libcxx_wrapper directory and tests are left for a separate effort. 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.
We only want to include what we need not the whole world
There are multiple cases where we only needed cuda::std::declval but included all of cuda::std::utility which is in the order of 100k LoC