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
2020-08-31 16:10:09 +00:00
родитель 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()