Skip to content

Refactor Thrust destroy_range and device_[new|delete|free] - #6134

Merged
bernhardmgruber merged 2 commits into
NVIDIA:mainfrom
bernhardmgruber:device_delete
Oct 13, 2025
Merged

bernhardmgruber merged 2 commits into
NVIDIA:mainfrom
bernhardmgruber:device_delete

Conversation

@bernhardmgruber

@bernhardmgruber bernhardmgruber commented Oct 6, 2025 •

Copy link
Copy Markdown
Contributor

This PR basically moves the content of .inl files into their headers, replaced some SFINAE by if constexpr and some traits by variable templates.

@github-actions

This comment has been minimized.

@miscco miscco 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.

We should definitely consolidate with the std conformant parts in libcu++

@github-actions

This comment has been minimized.

@bernhardmgruber
bernhardmgruber enabled auto-merge (squash) October 13, 2025 10:57
@github-actions

Copy link
Copy Markdown
Contributor

🥳 CI Workflow Results

🟩 Finished in 6h 19m: Pass: 100%/69 | Total: 2d 23h | Max: 2h 52m | Hits: 60%/116284

See results here.

@bernhardmgruber
bernhardmgruber merged commit 700f2a8 into NVIDIA:main Oct 13, 2025
154 of 159 checks passed
@github-project-automation github-project-automation Bot moved this from In Review to Done in CCCL Oct 13, 2025
@bernhardmgruber
bernhardmgruber deleted the device_delete branch October 13, 2025 14:03
Naraenda pushed a commit to ROCm/rocm-libraries that referenced this pull request Oct 26, 2026
…ge` and `device_[new|delete|free]` (NVIDIA/cccl#6134)

Upstream: NVIDIA/cccl@700f2a8

Took upstream refactor: destroy_range.inl, device_delete.inl, device_free.inl, device_new.inl folded into their headers (git rm of the .inl files); destroy_range now uses if constexpr over has_effectful_member_destroy (variable template, std::allocator specialization false) instead of enable_if cases. Local spellings kept (THRUST_HOST_DEVICE, THRUST_EXEC_CHECK_DISABLE, _THRUST_STD::is_trivially_destructible_v); destroy_range.h keeps <thrust/detail/memory_wrapper.h> (see ab99d87e866) and the !_THRUST_HAS_DEVICE_SYSTEM_STD <type_traits> fallback. HIP: no change (generic headers). test/: no counterpart. testing/: no counterpart. 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
…ocator <type_traits> fallbacks

Related upstream commit: 700f2a867a7 Refactor Thrust `destroy_range` and `device_[new|delete|free]` (NVIDIA/cccl#6134)
Related upstream commit: fbb9479172c Refactor Thrust allocator internals (NVIDIA/cccl#6136)
Related local port commits: 63becda, 17ee233

libhipcxx is now mandatory, so remove the `#if !_THRUST_HAS_DEVICE_SYSTEM_STD` <type_traits>
fallbacks from detail/allocator/{destroy_range,value_initialize_range,fill_construct_range,
copy_construct_range}.h, detail/temporary_array.h and detail/execute_with_allocator.h, and add the
upstream granular _THRUST_STD_INCLUDE headers (__iterator/advance.h, __iterator/distance.h,
__type_traits/is_convertible.h, __type_traits/is_trivially_copy_constructible.h,
__type_traits/type_identity.h, __utility/pair.h).
thrust/detail/memory_wrapper.h stays: <cuda/std/__cccl/memory_wrapper.h> is not in libhipcxx.

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
…ge` and `device_[new|delete|free]` (NVIDIA/cccl#6134)

Upstream: NVIDIA/cccl@700f2a8

Took upstream refactor: destroy_range.inl, device_delete.inl, device_free.inl, device_new.inl folded into their headers (git rm of the .inl files); destroy_range now uses if constexpr over has_effectful_member_destroy (variable template, std::allocator specialization false) instead of enable_if cases. Local spellings kept (THRUST_HOST_DEVICE, THRUST_EXEC_CHECK_DISABLE, _THRUST_STD::is_trivially_destructible_v); destroy_range.h keeps <thrust/detail/memory_wrapper.h> (see ab99d87e866) and the !_THRUST_HAS_DEVICE_SYSTEM_STD <type_traits> fallback. HIP: no change (generic headers). test/: no counterpart. testing/: no counterpart. 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
…ge` and `device_[new|delete|free]` (NVIDIA/cccl#6134)

Upstream: NVIDIA/cccl@700f2a8

Took upstream refactor: destroy_range.inl, device_delete.inl, device_free.inl, device_new.inl folded into their headers (git rm of the .inl files); destroy_range now uses if constexpr over has_effectful_member_destroy (variable template, std::allocator specialization false) instead of enable_if cases. Local spellings kept (THRUST_HOST_DEVICE, THRUST_EXEC_CHECK_DISABLE, _THRUST_STD::is_trivially_destructible_v); destroy_range.h keeps <thrust/detail/memory_wrapper.h> (see ab99d87e866) and the !_THRUST_HAS_DEVICE_SYSTEM_STD <type_traits> fallback. HIP: no change (generic headers). test/: no counterpart. testing/: no counterpart. 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
…ocator <type_traits> fallbacks

Related upstream commit: 700f2a867a7 Refactor Thrust `destroy_range` and `device_[new|delete|free]` (NVIDIA/cccl#6134)
Related upstream commit: fbb9479172c Refactor Thrust allocator internals (NVIDIA/cccl#6136)
Related local port commits: 63becda, 17ee233

libhipcxx is now mandatory, so remove the `#if !_THRUST_HAS_DEVICE_SYSTEM_STD` <type_traits>
fallbacks from detail/allocator/{destroy_range,value_initialize_range,fill_construct_range,
copy_construct_range}.h, detail/temporary_array.h and detail/execute_with_allocator.h, and add the
upstream granular _THRUST_STD_INCLUDE headers (__iterator/advance.h, __iterator/distance.h,
__type_traits/is_convertible.h, __type_traits/is_trivially_copy_constructible.h,
__type_traits/type_identity.h, __utility/pair.h).
thrust/detail/memory_wrapper.h stays: <cuda/std/__cccl/memory_wrapper.h> is not in libhipcxx.

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
…ge` and `device_[new|delete|free]` (NVIDIA/cccl#6134)

Upstream: NVIDIA/cccl@700f2a8

Took upstream refactor: destroy_range.inl, device_delete.inl, device_free.inl, device_new.inl folded into their headers (git rm of the .inl files); destroy_range now uses if constexpr over has_effectful_member_destroy (variable template, std::allocator specialization false) instead of enable_if cases. Local spellings kept (THRUST_HOST_DEVICE, THRUST_EXEC_CHECK_DISABLE, _THRUST_STD::is_trivially_destructible_v); destroy_range.h keeps <thrust/detail/memory_wrapper.h> (see ab99d87e866) and the !_THRUST_HAS_DEVICE_SYSTEM_STD <type_traits> fallback. HIP: no change (generic headers). test/: no counterpart. testing/: no counterpart. 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
…ge` and `device_[new|delete|free]` (NVIDIA/cccl#6134)

Upstream: NVIDIA/cccl@700f2a8

Took upstream refactor: destroy_range.inl, device_delete.inl, device_free.inl, device_new.inl folded into their headers (git rm of the .inl files); destroy_range now uses if constexpr over has_effectful_member_destroy (variable template, std::allocator specialization false) instead of enable_if cases. Local spellings kept (THRUST_HOST_DEVICE, THRUST_EXEC_CHECK_DISABLE, _THRUST_STD::is_trivially_destructible_v); destroy_range.h keeps <thrust/detail/memory_wrapper.h> (see ab99d87e866) and the !_THRUST_HAS_DEVICE_SYSTEM_STD <type_traits> fallback. HIP: no change (generic headers). test/: no counterpart. testing/: no counterpart. 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
…ocator <type_traits> fallbacks

Related upstream commit: 700f2a867a7 Refactor Thrust `destroy_range` and `device_[new|delete|free]` (NVIDIA/cccl#6134)
Related upstream commit: fbb9479172c Refactor Thrust allocator internals (NVIDIA/cccl#6136)
Related local port commits: 63becda, 17ee233

libhipcxx is now mandatory, so remove the `#if !_THRUST_HAS_DEVICE_SYSTEM_STD` <type_traits>
fallbacks from detail/allocator/{destroy_range,value_initialize_range,fill_construct_range,
copy_construct_range}.h, detail/temporary_array.h and detail/execute_with_allocator.h, and add the
upstream granular _THRUST_STD_INCLUDE headers (__iterator/advance.h, __iterator/distance.h,
__type_traits/is_convertible.h, __type_traits/is_trivially_copy_constructible.h,
__type_traits/type_identity.h, __utility/pair.h).
thrust/detail/memory_wrapper.h stays: <cuda/std/__cccl/memory_wrapper.h> is not in libhipcxx.

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