From fc3931f81a39301c73e96bbf4f77495e87344cc4 Mon Sep 17 00:00:00 2001 From: Marcel Koch Date: Fri, 16 Aug 2024 12:43:44 +0200 Subject: [PATCH] [cmake] add rocthrust through cmake --- cmake/GinkgoConfig.cmake.in | 1 + cmake/hip.cmake | 1 + hip/CMakeLists.txt | 2 +- 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/cmake/GinkgoConfig.cmake.in b/cmake/GinkgoConfig.cmake.in index 23b1d25adc1..1f12251f93d 100644 --- a/cmake/GinkgoConfig.cmake.in +++ b/cmake/GinkgoConfig.cmake.in @@ -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() diff --git a/cmake/hip.cmake b/cmake/hip.cmake index c94117242eb..bd834c3ebde 100644 --- a/cmake/hip.cmake +++ b/cmake/hip.cmake @@ -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) diff --git a/hip/CMakeLists.txt b/hip/CMakeLists.txt index 30e675509d5..46b2d7bd19b 100644 --- a/hip/CMakeLists.txt +++ b/hip/CMakeLists.txt @@ -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()