Skip to content

Commit e1a816b

Browse files
authored
Offload arch linking (ROCm#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.
1 parent 8bfb67f commit e1a816b

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

‎src/CMakeLists.txt‎

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,9 @@
55
# Compile common object library
66
set_property(SOURCE common.cu timer.cc ../verifiable/verifiable.cu PROPERTY LANGUAGE CXX)
77
add_library(rccl_common OBJECT common.cu timer.cc ../verifiable/verifiable.cu)
8+
target_link_libraries(rccl_common roc::rccl hip::device)
89
if(USE_MPI)
9-
target_link_libraries(rccl_common roc::rccl MPI::MPI_CXX)
10-
else()
11-
target_link_libraries(rccl_common roc::rccl)
10+
target_link_libraries(rccl_common MPI::MPI_CXX)
1211
endif()
1312

1413
function(add_relative_test test_name test_target)
@@ -38,11 +37,6 @@ function(add_rccl_test TEST)
3837
PRIVATE
3938
rccl_common
4039
)
41-
if (NOT WIN32)
42-
foreach(amdgpu_target ${AMDGPU_TARGETS})
43-
target_link_libraries(${TEST_TARGET} PRIVATE --amdgpu-target=${amdgpu_target})
44-
endforeach()
45-
endif()
4640
set_target_properties(
4741
${TEST_TARGET}
4842
PROPERTIES

0 commit comments

Comments
 (0)