diff --git a/benchmark/CMakeLists.txt b/benchmark/CMakeLists.txt index 954983e5d..3bc18ef32 100644 --- a/benchmark/CMakeLists.txt +++ b/benchmark/CMakeLists.txt @@ -49,7 +49,7 @@ foreach(benchmark_src ${rocRAND_BENCHMARK_SRCS}) else() target_link_libraries(${benchmark_name} rocrand - hip::hip_hcc hip::hip_device + hip::device ) endif() foreach(amdgpu_target ${AMDGPU_TARGETS}) diff --git a/library/CMakeLists.txt b/library/CMakeLists.txt index bd089928f..504d532b5 100644 --- a/library/CMakeLists.txt +++ b/library/CMakeLists.txt @@ -56,16 +56,15 @@ else() add_library(rocrand ${rocRAND_SRCS}) # Remove this check when we no longer build with older rocm stack(ie < 1.8.2) - if(TARGET hip::device) + if(CXX_VERSION_STRING MATCHES "clang") target_link_libraries(rocrand PRIVATE hip::device) else() target_link_libraries(rocrand PRIVATE - # We keep hip::hip_hcc private, because otherwise it's not possible + # We keep hip::device private, because otherwise it's not possible # to link to roc::rocrand when using different compiler than hcc, - # hip::hip_hcc adds hcc-specific compilation flags. - hip::hip_hcc - hip::hip_device + # hip::device adds hcc-specific compilation flags. + hip::device hcc::hccshared ) endif() @@ -172,10 +171,10 @@ if(HIP_PLATFORM STREQUAL "nvcc") ) else() # Remove this check when we no longer build with older rocm stack(ie < 1.8.2) - if(TARGET hip::device) + if(CXX_VERSION_STRING MATCHES "clang") target_link_libraries(hiprand PRIVATE rocrand hip::device) else() - target_link_libraries(hiprand PRIVATE rocrand hip::hip_hcc hip::hip_device hcc::hccshared) + target_link_libraries(hiprand PRIVATE rocrand hip::device hcc::hccshared) endif() foreach(amdgpu_target ${AMDGPU_TARGETS}) target_link_libraries(hiprand PRIVATE --amdgpu-target=${amdgpu_target}) diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 8b43605bc..4f9be3023 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -50,7 +50,7 @@ foreach(test_src ${rocRAND_TEST_SRCS}) if(TARGET hip::device) target_link_libraries(${test_name} hip::device) else() - target_link_libraries(${test_name} hip::hip_hcc hip::hip_device) + target_link_libraries(${test_name} hip::device ) endif() foreach(amdgpu_target ${AMDGPU_TARGETS}) target_link_libraries(${test_name} --amdgpu-target=${amdgpu_target}) @@ -116,7 +116,7 @@ foreach(test_src ${hipRAND_TEST_SRCS}) if(TARGET hip::device) target_link_libraries(${test_name} hip::device) else() - target_link_libraries(${test_name} hip::hip_hcc hip::hip_device) + target_link_libraries(${test_name} hip::device ) endif() foreach(amdgpu_target ${AMDGPU_TARGETS}) target_link_libraries(${test_name} --amdgpu-target=${amdgpu_target}) diff --git a/test/crush/CMakeLists.txt b/test/crush/CMakeLists.txt index dfe049ae9..2a40e131d 100644 --- a/test/crush/CMakeLists.txt +++ b/test/crush/CMakeLists.txt @@ -56,7 +56,7 @@ foreach(crush_test_src ${rocRAND_CRUSH_TEST_SRCS}) else() target_link_libraries(${crush_test_name} rocrand - hip::hip_hcc hip::hip_device + hip::device ${TestU01_LIBRARIES} ) endif() diff --git a/test/linkage/CMakeLists.txt b/test/linkage/CMakeLists.txt index 9c5cfa099..d5a969153 100644 --- a/test/linkage/CMakeLists.txt +++ b/test/linkage/CMakeLists.txt @@ -45,7 +45,7 @@ function(add_rocrand_link_test TEST_SOURCES) if(TARGET hip::device) target_link_libraries(${TEST_TARGET} hip::device) else() - target_link_libraries(${TEST_TARGET} hip::hip_hcc hip::hip_device) + target_link_libraries(${TEST_TARGET} hip::device ) endif() foreach(amdgpu_target ${AMDGPU_TARGETS}) target_link_libraries(${TEST_TARGET} --amdgpu-target=${amdgpu_target}) @@ -101,7 +101,7 @@ function(add_hiprand_link_test TEST_SOURCES) if(TARGET hip::device) target_link_libraries(${TEST_TARGET} hip::device) else() - target_link_libraries(${TEST_TARGET} hip::hip_hcc hip::hip_device) + target_link_libraries(${TEST_TARGET} hip::device ) endif() foreach(amdgpu_target ${AMDGPU_TARGETS}) target_link_libraries(${TEST_TARGET} --amdgpu-target=${amdgpu_target})