Skip to content

feat(rocthrust): allow grafting thrust onto benchmarks - #8538

Open
Naraenda wants to merge 5 commits into
developfrom
users/naraenda/rocthrust-allow-grafting-thrust
Open

feat(rocthrust): allow grafting thrust onto benchmarks#8538
Naraenda wants to merge 5 commits into
developfrom
users/naraenda/rocthrust-allow-grafting-thrust

Conversation

@Naraenda

@Naraenda Naraenda commented Jun 17, 2026

Copy link
Copy Markdown
Member

Motivation

Allows compilation of rocThrust benchmark with non-rocThrust libraries by adding some required compatibility layer and including said non-rocThrust header-only library.

Required by #8499.

JIRA ID : AIPRIMS-208

Technical Details

I've added a CMakePresets.json because putting the required flags in CMakeLists.txt is not the way to go. This also isn't user-facing so I don't want to include this in user facing documentation.

Test Plan

It's a secret.

Test Result

Works on my machine.

Submission Checklist

@Naraenda Naraenda changed the title Users/naraenda/rocthrust allow grafting thrust feat(rocthrust): allow grafting thrust onto benchmarks Jun 17, 2026
@assistant-librarian assistant-librarian Bot added the organization: streamhpc contributors from streamhpc label Jun 17, 2026
@github-actions

Copy link
Copy Markdown
Contributor

This pull request has been inactive for 25 days and will be marked as stale.

If you would like to keep this PR open, please:

  • Add new commits
  • Add a comment explaining why it should remain open

This PR will be automatically closed in 5 days if no further activity occurs.

@github-actions github-actions Bot added the Stale PR has no activity for 25+ days label Jul 13, 2026
Comment thread projects/rocthrust/cmake/Summary.cmake Outdated
Comment thread projects/rocthrust/cmake/Dependencies.cmake Outdated
Comment thread projects/rocthrust/cmake/Dependencies.cmake Outdated
Comment thread projects/rocthrust/cmake/VerifyCompiler.cmake Outdated
Comment thread projects/rocthrust/CMakePresets.json
@Naraenda
Naraenda force-pushed the users/naraenda/rocthrust-allow-grafting-thrust branch from 53cfd86 to e44e57b Compare July 15, 2026 15:18
@therock-pr-bot

therock-pr-bot Bot commented Jul 15, 2026

Copy link
Copy Markdown

❌ PR Check — Action Required

Check Status Details
🌿 Branch Name ✅ Pass
📝 PR Title/Description ✅ Pass
Forbidden Files ✅ Pass
🧪 Unit Test ❌ Fail Error: Source/code files changed without an accompanying unit test.
Expected: add at least one test file named like test_<name>.py / test_<name>.cpp (or <name>_test.*).
Current: code file(s) changed: projects/rocthrust/benchmark/bench_utils/bench_utils.hpp, projects/rocthrust/benchmark/bench_utils/generation_utils.hpp, projects/rocthrust/benchmark/bench_utils/thrust_compat.hpp, projects/rocthrust/testing/unittest/meta.h; no test file found
🔎 pre-commit ✅ Pass
🚫 Draft PR 🔜 To Be Enabled
🚩 Feature Flag 🔜 To Be Enabled
📊 Code Coverage 🔜 To Be Enabled

⚠️ 1 policy check(s) failed. Please address the issues above before this PR can be Reviewed.

🚫 Please fix the failed policies

  • ❌ Unit Test

The Not ready to Review label was added to this PR. Once all policies pass, the label is removed automatically.

📖 Need help? See the Policy FAQ for details on every check and how to fix failures.

@therock-pr-bot

therock-pr-bot Bot commented Jul 15, 2026

Copy link
Copy Markdown

🚫 Please fix the failed policies before requesting reviews.

The following policy checks failed:

  • ❌ Unit Test

The Not ready to Review label has been added to this PR.
Once all policies pass, the label will be removed automatically.

@Naraenda
Naraenda marked this pull request as ready for review July 15, 2026 15:25
@Naraenda
Naraenda requested a review from a team as a code owner July 15, 2026 15:25
@MyNameIsTrez

Copy link
Copy Markdown
Contributor

All the code changes look correct to me, thanks.

@codecov-commenter

codecov-commenter commented Jul 15, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #8538      +/-   ##
===========================================
- Coverage    64.20%   64.20%   -0.00%     
===========================================
  Files         2761     2761              
  Lines       450031   450035       +4     
  Branches     66215    66215              
===========================================
- Hits        288929   288927       -2     
- Misses      140236   140240       +4     
- Partials     20866    20868       +2     
Flag Coverage Δ *Carryforward flag
TensileLite 34.35% <ø> (ø) Carriedforward from 2dcef14
TensileLite-CPP 38.28% <ø> (ø) Carriedforward from 2dcef14
TensileLite-Unit 35.52% <ø> (ø) Carriedforward from 2dcef14
hipBLAS 90.62% <ø> (ø) Carriedforward from 2dcef14
hipBLASLt 34.63% <ø> (ø) Carriedforward from 2dcef14
hipCUB 82.68% <ø> (ø) Carriedforward from 2dcef14
hipDNN 86.31% <ø> (ø) Carriedforward from 2dcef14
hipFFT 50.30% <ø> (ø) Carriedforward from 2dcef14
hipRAND 76.12% <ø> (ø) Carriedforward from 2dcef14
hipSOLVER 69.18% <ø> (ø) Carriedforward from 2dcef14
hipSPARSE 86.27% <ø> (ø) Carriedforward from 2dcef14
rocBLAS 47.95% <ø> (ø) Carriedforward from 2dcef14
rocFFT 49.16% <ø> (ø) Carriedforward from 2dcef14
rocRAND 57.02% <ø> (+0.01%) ⬆️
rocSOLVER 76.84% <ø> (ø) Carriedforward from 2dcef14
rocSPARSE 72.44% <ø> (ø) Carriedforward from 2dcef14
rocThrust 91.34% <ø> (-0.01%) ⬇️

*This pull request uses carry forward flags. Click here to find out more.
see 6 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.

@github-actions github-actions Bot removed the Stale PR has no activity for 25+ days label Jul 16, 2026

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

Using -DCODE_COVERAGE=ON -DBUILD_TEST=ON -DBUILD_BENCHMARK=ON while compiling for rocThrust I am getting the following error:

lld: error: undefined symbol: __llvm_profile_instrument_gpu
>>> referenced by /tmp/testframework-gfx1201-84f2d8.o:(dummy_kernel())
>>> referenced by /tmp/testframework-gfx1201-84f2d8.o:(dummy_kernel())
clang++: error: amdgcn-link command failed with exit code 1 (use -v to see invocation)
failed to execute:/opt/rocm/lib/llvm/bin/clang++  --offload-arch=gfx1201  -DTHRUST_DEVICE_SYSTEM=THRUST_DEVICE_SYSTEM_HIP -DTHRUST_HOST_SYSTEM=THRUST_HOST_SYSTEM_CPP -DUSE_LIBCUDACXX -DUSE_LIBHIPCXX -DUSE_PROF_API=1 -D__HIP_PLATFORM_AMD__=1 -I/dockerx/rocm-libraries/projects/rocthrust/build/thrust/include -I/dockerx/rocm-libraries/projects/rocthrust/thrust/.. -isystem /dockerx/rocm-libraries/projects/rocthrust/testing -isystem /dockerx/rocm-libraries/projects/rocthrust/build/_deps/googletest-src/googletest/include -isystem /dockerx/rocm-libraries/projects/rocthrust/build/_deps/googletest-src/googletest -w --offload-compress -Wno-unused-command-line-argument -O0 -fprofile-instr-generate -fcoverage-mapping -O3 -DNDEBUG -std=c++17 -Wall -Wextra -x hip -MD -MT testing/CMakeFiles/testframework.dir/unittest/hip/testframework.cu.o -MF CMakeFiles/testframework.dir/unittest/hip/testframework.cu.o.d -o "CMakeFiles/testframework.dir/unittest/hip/testframework.cu.o" -c /dockerx/rocm-libraries/projects/rocthrust/testing/unittest/hip/testframework.cu
make[2]: *** [testing/CMakeFiles/testframework.dir/build.make:90: testing/CMakeFiles/testframework.dir/unittest/hip/testframework.cu.o] Error 1
make[2]: *** Waiting for unfinished jobs....
lld: error: undefined symbol: __llvm_profile_instrument_gpu
>>> referenced by /tmp/test_unique_ptr_allocate_deallocate-gfx1201-a1b802.o:(void thrust::THRUST_200805_400400_NS::hip_rocprim::__parallel_for::kernel<256u, thrust::THRUST_200805_400400_NS::hip_rocprim::for_each_f<thrust::THRUST_200805_400400_NS::device_ptr<A>, thrust::THRUST_200805_400400_NS::detail::wrapped_function<thrust::THRUST_200805_400400_NS::default_delete<A, void>::operator()(thrust::THRUST_200805_400400_NS::device_ptr<A>) const::'lambda'(A&), void>>, int, 1u>(thrust::THRUST_200805_400400_NS::hip_rocprim::for_each_f<thrust::THRUST_200805_400400_NS::device_ptr<A>, thrust::THRUST_200805_400400_NS::detail::wrapped_function<thrust::THRUST_200805_400400_NS::default_delete<A, void>::operator()(thrust::THRUST_200805_400400_NS::device_ptr<A>) const::'lambda'(A&), void>>, int, int))
>>> referenced by /tmp/test_unique_ptr_allocate_deallocate-gfx1201-a1b802.o:(void thrust::THRUST_200805_400400_NS::hip_rocprim::__parallel_for::kernel<256u, thrust::THRUST_200805_400400_NS::hip_rocprim::for_each_f<thrust::THRUST_200805_400400_NS::device_ptr<A>, thrust::THRUST_200805_400400_NS::detail::wrapped_function<thrust::THRUST_200805_400400_NS::default_delete<A, void>::operator()(thrust::THRUST_200805_400400_NS::device_ptr<A>) const::'lambda'(A&), void>>, int, 1u>(thrust::THRUST_200805_400400_NS::hip_rocprim::for_each_f<thrust::THRUST_200805_400400_NS::device_ptr<A>, thrust::THRUST_200805_400400_NS::detail::wrapped_function<thrust::THRUST_200805_400400_NS::default_delete<A, void>::operator()(thrust::THRUST_200805_400400_NS::device_ptr<A>) const::'lambda'(A&), void>>, int, int))
>>> referenced by /tmp/test_unique_ptr_allocate_deallocate-gfx1201-a1b802.o:(void thrust::THRUST_200805_400400_NS::hip_rocprim::__parallel_for::kernel<256u, thrust::THRUST_200805_400400_NS::hip_rocprim::for_each_f<thrust::THRUST_200805_400400_NS::device_ptr<A>, thrust::THRUST_200805_400400_NS::detail::wrapped_function<thrust::THRUST_200805_400400_NS::default_delete<A, void>::operator()(thrust::THRUST_200805_400400_NS::device_ptr<A>) const::'lambda'(A&), void>>, int, 1u>(thrust::THRUST_200805_400400_NS::hip_rocprim::for_each_f<thrust::THRUST_200805_400400_NS::device_ptr<A>, thrust::THRUST_200805_400400_NS::detail::wrapped_function<thrust::THRUST_200805_400400_NS::default_delete<A, void>::operator()(thrust::THRUST_200805_400400_NS::device_ptr<A>) const::'lambda'(A&), void>>, int, int))
>>> referenced 41 more times

@Naraenda
Naraenda force-pushed the users/naraenda/rocthrust-allow-grafting-thrust branch from 239cd9a to b76aa95 Compare July 21, 2026 11:15
@Naraenda

Copy link
Copy Markdown
Member Author

Using -DCODE_COVERAGE=ON -DBUILD_TEST=ON -DBUILD_BENCHMARK=ON while compiling for rocThrust I am getting the following error:

lld: error: undefined symbol: __llvm_profile_instrument_gpu
>>> referenced by /tmp/testframework-gfx1201-84f2d8.o:(dummy_kernel())
>>> referenced by /tmp/testframework-gfx1201-84f2d8.o:(dummy_kernel())
clang++: error: amdgcn-link command failed with exit code 1 (use -v to see invocation)
failed to execute:/opt/rocm/lib/llvm/bin/clang++  --offload-arch=gfx1201  -DTHRUST_DEVICE_SYSTEM=THRUST_DEVICE_SYSTEM_HIP -DTHRUST_HOST_SYSTEM=THRUST_HOST_SYSTEM_CPP -DUSE_LIBCUDACXX -DUSE_LIBHIPCXX -DUSE_PROF_API=1 -D__HIP_PLATFORM_AMD__=1 -I/dockerx/rocm-libraries/projects/rocthrust/build/thrust/include -I/dockerx/rocm-libraries/projects/rocthrust/thrust/.. -isystem /dockerx/rocm-libraries/projects/rocthrust/testing -isystem /dockerx/rocm-libraries/projects/rocthrust/build/_deps/googletest-src/googletest/include -isystem /dockerx/rocm-libraries/projects/rocthrust/build/_deps/googletest-src/googletest -w --offload-compress -Wno-unused-command-line-argument -O0 -fprofile-instr-generate -fcoverage-mapping -O3 -DNDEBUG -std=c++17 -Wall -Wextra -x hip -MD -MT testing/CMakeFiles/testframework.dir/unittest/hip/testframework.cu.o -MF CMakeFiles/testframework.dir/unittest/hip/testframework.cu.o.d -o "CMakeFiles/testframework.dir/unittest/hip/testframework.cu.o" -c /dockerx/rocm-libraries/projects/rocthrust/testing/unittest/hip/testframework.cu
make[2]: *** [testing/CMakeFiles/testframework.dir/build.make:90: testing/CMakeFiles/testframework.dir/unittest/hip/testframework.cu.o] Error 1
make[2]: *** Waiting for unfinished jobs....
lld: error: undefined symbol: __llvm_profile_instrument_gpu
>>> referenced by /tmp/test_unique_ptr_allocate_deallocate-gfx1201-a1b802.o:(void thrust::THRUST_200805_400400_NS::hip_rocprim::__parallel_for::kernel<256u, thrust::THRUST_200805_400400_NS::hip_rocprim::for_each_f<thrust::THRUST_200805_400400_NS::device_ptr<A>, thrust::THRUST_200805_400400_NS::detail::wrapped_function<thrust::THRUST_200805_400400_NS::default_delete<A, void>::operator()(thrust::THRUST_200805_400400_NS::device_ptr<A>) const::'lambda'(A&), void>>, int, 1u>(thrust::THRUST_200805_400400_NS::hip_rocprim::for_each_f<thrust::THRUST_200805_400400_NS::device_ptr<A>, thrust::THRUST_200805_400400_NS::detail::wrapped_function<thrust::THRUST_200805_400400_NS::default_delete<A, void>::operator()(thrust::THRUST_200805_400400_NS::device_ptr<A>) const::'lambda'(A&), void>>, int, int))
>>> referenced by /tmp/test_unique_ptr_allocate_deallocate-gfx1201-a1b802.o:(void thrust::THRUST_200805_400400_NS::hip_rocprim::__parallel_for::kernel<256u, thrust::THRUST_200805_400400_NS::hip_rocprim::for_each_f<thrust::THRUST_200805_400400_NS::device_ptr<A>, thrust::THRUST_200805_400400_NS::detail::wrapped_function<thrust::THRUST_200805_400400_NS::default_delete<A, void>::operator()(thrust::THRUST_200805_400400_NS::device_ptr<A>) const::'lambda'(A&), void>>, int, 1u>(thrust::THRUST_200805_400400_NS::hip_rocprim::for_each_f<thrust::THRUST_200805_400400_NS::device_ptr<A>, thrust::THRUST_200805_400400_NS::detail::wrapped_function<thrust::THRUST_200805_400400_NS::default_delete<A, void>::operator()(thrust::THRUST_200805_400400_NS::device_ptr<A>) const::'lambda'(A&), void>>, int, int))
>>> referenced by /tmp/test_unique_ptr_allocate_deallocate-gfx1201-a1b802.o:(void thrust::THRUST_200805_400400_NS::hip_rocprim::__parallel_for::kernel<256u, thrust::THRUST_200805_400400_NS::hip_rocprim::for_each_f<thrust::THRUST_200805_400400_NS::device_ptr<A>, thrust::THRUST_200805_400400_NS::detail::wrapped_function<thrust::THRUST_200805_400400_NS::default_delete<A, void>::operator()(thrust::THRUST_200805_400400_NS::device_ptr<A>) const::'lambda'(A&), void>>, int, 1u>(thrust::THRUST_200805_400400_NS::hip_rocprim::for_each_f<thrust::THRUST_200805_400400_NS::device_ptr<A>, thrust::THRUST_200805_400400_NS::detail::wrapped_function<thrust::THRUST_200805_400400_NS::default_delete<A, void>::operator()(thrust::THRUST_200805_400400_NS::device_ptr<A>) const::'lambda'(A&), void>>, int, int))
>>> referenced 41 more times

Ah, weird. I think something must have gone wrong during a rebase, or conflict resolution. Should be resolved with b76aa95.

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.

4 participants