Skip to content

Commit

Permalink
Merge Adding rocthrust through cmake
Browse files Browse the repository at this point in the history
This merge uses CMake to find and add rocthrust. This fixes the spack issue reported in spack/spack#44923.

Related PR: #1668
  • Loading branch information
MarcelKoch committed Aug 20, 2024
2 parents 9f1c41b + fc3931f commit 369b12a
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions cmake/GinkgoConfig.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,7 @@ if((NOT GINKGO_BUILD_SHARED_LIBS) AND GINKGO_BUILD_HIP)
find_dependency(hiprand)
find_dependency(hipsparse)
find_dependency(rocrand)
find_dependency(rocthrust)
set_and_check(ROCTRACER_PATH "@ROCTRACER_PATH@")
find_dependency(ROCTX)
endif()
Expand Down
1 change: 1 addition & 0 deletions cmake/hip.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ find_package(hiprand REQUIRED)
find_package(hipsparse REQUIRED)
# At the moment, for hiprand to work also rocrand is required.
find_package(rocrand REQUIRED)
find_package(rocthrust REQUIRED)
find_package(ROCTX)

if(GINKGO_HIP_AMD_UNSAFE_ATOMIC AND GINKGO_HIP_VERSION VERSION_GREATER_EQUAL 5)
Expand Down
2 changes: 1 addition & 1 deletion hip/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ target_include_directories(ginkgo_hip
target_compile_definitions(ginkgo_hip PRIVATE GKO_COMPILING_HIP GKO_DEVICE_NAMESPACE=hip)

target_link_libraries(ginkgo_hip PUBLIC ginkgo_device)
target_link_libraries(ginkgo_hip PRIVATE hip::host roc::hipblas roc::hipsparse hip::hiprand roc::rocrand)
target_link_libraries(ginkgo_hip PRIVATE hip::host roc::hipblas roc::hipsparse hip::hiprand roc::rocrand roc::rocthrust)
if (hipfft_FOUND)
target_link_libraries(ginkgo_hip PRIVATE hip::hipfft)
endif()
Expand Down

0 comments on commit 369b12a

Please sign in to comment.