From e1a816b8691cc6fa4fcada2e32db29be2f1650cd Mon Sep 17 00:00:00 2001 From: Lauren Wrubleski Date: Tue, 5 Dec 2023 18:20:46 -0700 Subject: [PATCH] Offload arch linking (#54) * Update CMakeLists.txt * Update CMakeLists.txt * Link rccl_common object against hip::device Previously the tests were compiled with `--amdgpu-target` to compile for multiple architectures, As rccl_common was not compiled against those architectures, this didn't work. Linking it against hip::device automatically links against all architectures in `AMDGPU_TARGETS`, and so are the test executables. --- src/CMakeLists.txt | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 6511a419c9..41d312855f 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -5,10 +5,9 @@ # Compile common object library set_property(SOURCE common.cu timer.cc ../verifiable/verifiable.cu PROPERTY LANGUAGE CXX) add_library(rccl_common OBJECT common.cu timer.cc ../verifiable/verifiable.cu) +target_link_libraries(rccl_common roc::rccl hip::device) if(USE_MPI) - target_link_libraries(rccl_common roc::rccl MPI::MPI_CXX) -else() - target_link_libraries(rccl_common roc::rccl) + target_link_libraries(rccl_common MPI::MPI_CXX) endif() function(add_relative_test test_name test_target) @@ -38,11 +37,6 @@ function(add_rccl_test TEST) PRIVATE rccl_common ) - if (NOT WIN32) - foreach(amdgpu_target ${AMDGPU_TARGETS}) - target_link_libraries(${TEST_TARGET} PRIVATE --amdgpu-target=${amdgpu_target}) - endforeach() - endif() set_target_properties( ${TEST_TARGET} PROPERTIES