Add RCCL Static Lib Creation with -fgpu-rdc

RCCL uses -fgpu-rdc to compile its source objects. When linking
the RCCL static library, the link and archive step must do through
hipcc and uses the flag --emit-static-lib. When compiling
UnitTests, the librccl.a must be consumed through -l and -L.
このコミットが含まれているのは:
Aaron Enye Shi committed 2020-09-03 11:25:41 -04:00
1 親 e2042ccf8a
コミット 958b213428
2ファイル変更
+20 -1

検索条件に一致するファイルはありません

+11 -1
ファイルの表示
@@ -25,7 +25,17 @@ if(BUILD_TESTS)
add_executable(UnitTests ${TEST_SOURCES})
target_include_directories(UnitTests PRIVATE /opt/rocm ${GTEST_INCLUDE_DIRS})
target_link_libraries(UnitTests PRIVATE ${GTEST_BOTH_LIBRARIES} PRIVATE rccl)
target_link_libraries(UnitTests PRIVATE ${GTEST_BOTH_LIBRARIES})
# UnitTests using static library of rccl requires passing rccl
# through -l and -L instead of command line input.
if(BUILD_STATIC)
add_dependencies(UnitTests rccl)
target_link_libraries(UnitTests PRIVATE dl rt numa -lrccl -L${CMAKE_BINARY_DIR})
target_link_libraries(UnitTests PRIVATE amdhip64 amd_comgr hsa-runtime64::hsa-runtime64)
else()
target_link_libraries(UnitTests PRIVATE rccl)
endif()
else()
message("Not building unit tests")
endif()