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.
This commit is contained in:
+2
-8
@@ -5,10 +5,9 @@
|
|||||||
# Compile common object library
|
# Compile common object library
|
||||||
set_property(SOURCE common.cu timer.cc ../verifiable/verifiable.cu PROPERTY LANGUAGE CXX)
|
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)
|
add_library(rccl_common OBJECT common.cu timer.cc ../verifiable/verifiable.cu)
|
||||||
|
target_link_libraries(rccl_common roc::rccl hip::device)
|
||||||
if(USE_MPI)
|
if(USE_MPI)
|
||||||
target_link_libraries(rccl_common roc::rccl MPI::MPI_CXX)
|
target_link_libraries(rccl_common MPI::MPI_CXX)
|
||||||
else()
|
|
||||||
target_link_libraries(rccl_common roc::rccl)
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
function(add_relative_test test_name test_target)
|
function(add_relative_test test_name test_target)
|
||||||
@@ -38,11 +37,6 @@ function(add_rccl_test TEST)
|
|||||||
PRIVATE
|
PRIVATE
|
||||||
rccl_common
|
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(
|
set_target_properties(
|
||||||
${TEST_TARGET}
|
${TEST_TARGET}
|
||||||
PROPERTIES
|
PROPERTIES
|
||||||
|
|||||||
Reference in New Issue
Block a user