Skip to content

[rocthrust] Fix THRUST_CUB_WRAPPED_NAMESPACE compile errors in headers - #6460

Closed
darren-amd wants to merge 1 commit into
developfrom
users/darren-amd/fix-thrust-headers
Closed

darren-amd wants to merge 1 commit into
developfrom
users/darren-amd/fix-thrust-headers

Conversation

@darren-amd

@darren-amd darren-amd commented Apr 15, 2026 •

Copy link
Copy Markdown
Contributor

Motivation

Fixes #6309

When THRUST_CUB_WRAPPED_NAMESPACE is defined (e.g., gko for the Ginkgo project), the thrust namespace is wrapped:

namespace gko { namespace thrust { ... } }

Several headers use hardcoded ::thrust:: references in #else branches (when _THRUST_HAS_DEVICE_SYSTEM_STD is false), which fail to resolve.

Technical Details

Replaced hardcoded ::thrust:: with THRUST_NS_QUALIFIER in three locations across two files

THRUST_NS_QUALIFIER resolves to ::THRUST_WRAPPED_NAMESPACE::thrust when a wrapped namespace is defined, and ::thrust otherwise, so this is not an issue for unwrapped builds.

Test Plan

  • Make sure that rocThrust builds and tests pass

Test Result

  • Builds successfully and tests pass

Submission Checklist

Made-with: Cursor
@codecov-commenter

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

❌ Your project status has failed because the head coverage (47.50%) is below the target coverage (80.00%). You can increase the head coverage or adjust the target coverage.

Additional details and impacted files
@@           Coverage Diff            @@
##           develop    #6460   +/-   ##
========================================
  Coverage    66.54%   66.54%           
========================================
  Files         2176     2176           
  Lines       322657   322657           
  Branches     41670    41671    +1     
========================================
+ Hits        214707   214708    +1     
+ Misses       93296    93295    -1     
  Partials     14654    14654           
Flag Coverage Δ *Carryforward flag
hipBLAS 90.67% <ø> (ø) Carriedforward from 72ae66e
hipBLASLt 39.95% <ø> (ø) Carriedforward from 72ae66e
hipCUB 82.21% <ø> (ø) Carriedforward from 72ae66e
hipDNN 81.75% <ø> (ø) Carriedforward from 72ae66e
hipFFT 55.00% <ø> (ø) Carriedforward from 72ae66e
hipRAND 76.12% <ø> (ø) Carriedforward from 72ae66e
rocBLAS 48.11% <ø> (ø) Carriedforward from 72ae66e
rocFFT 47.50% <ø> (ø) Carriedforward from 72ae66e
rocPRIM 38.96% <ø> (ø) Carriedforward from 72ae66e
rocRAND 57.09% <ø> (ø) Carriedforward from 72ae66e
rocSPARSE 71.46% <ø> (ø) Carriedforward from 72ae66e
rocThrust 91.37% <ø> (+<0.01%) ⬆️

*This pull request uses carry forward flags. Click here to find out more.

Files with missing lines Coverage Δ
...ust/iterator/detail/tuple_of_iterator_references.h 100.00% <ø> (ø)

... and 2 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@Naraenda

Copy link
Copy Markdown
Member

@darren-amd There's also a ::thrust::detail::... being used in thrust/system/hip/detail/sort.h::dispatch. Should that be changed too?

@matyas-streamhpc @yungshengtu does this also impact the CCCL 3.x branches?

@darren-amd

Copy link
Copy Markdown
Contributor Author

Fixed with: 137dda8

@darren-amd darren-amd closed this Apr 20, 2026
yungshengtu added a commit that referenced this pull request Apr 30, 2026
yungshengtu added a commit that referenced this pull request May 15, 2026
yungshengtu added a commit that referenced this pull request May 20, 2026
yungshengtu added a commit that referenced this pull request May 22, 2026
yungshengtu added a commit that referenced this pull request May 22, 2026
yungshengtu added a commit that referenced this pull request May 30, 2026
yungshengtu added a commit that referenced this pull request Jun 11, 2026
yungshengtu added a commit that referenced this pull request Jun 12, 2026
yungshengtu added a commit that referenced this pull request Jun 12, 2026
yungshengtu added a commit that referenced this pull request Jun 29, 2026
yungshengtu added a commit that referenced this pull request Jun 29, 2026
yungshengtu added a commit that referenced this pull request Jul 3, 2026
stanleytsang-amd pushed a commit that referenced this pull request Jul 16, 2026
yungshengtu added a commit that referenced this pull request Jul 17, 2026
yungshengtu added a commit that referenced this pull request Jul 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Issue]: define THRUST_CUB_WRAPPED_NAMESPACE gives compile error in ROCM 7.2.0

3 participants