Changed the name of UnitTests to rccl-UnitTests (wrapper executable included).

Cette révision appartient à :
PedramAlizadeh
2022-12-13 21:45:57 +00:00
Parent 8250092367
révision 45872d170f
6 fichiers modifiés avec 48 ajouts et 37 suppressions
+18 -17
Voir le fichier
@@ -5,11 +5,11 @@ cmake_minimum_required(VERSION 2.8.12)
if(BUILD_TESTS)
message("Building unit tests (Installed in /test/UnitTests)")
message("Building rccl unit tests (Installed in /test/rccl-UnitTests)")
find_program(CHRPATH chrpath)
if(NOT CHRPATH)
message(FATAL_ERROR "chrpath is required for UnitTests. Please install (e.g. sudo apt-get install chrpath)")
message(FATAL_ERROR "chrpath is required for rccl-UnitTests. Please install (e.g. sudo apt-get install chrpath)")
endif()
find_package(hsa-runtime64 PATHS /opt/rocm )
@@ -98,31 +98,32 @@ if(BUILD_TESTS)
)
endif()
add_executable(UnitTests ${COMMON_SOURCE_FILES} ${TEST_SOURCE_FILES})
target_include_directories(UnitTests PRIVATE ${ROCM_PATH} ${GTEST_INCLUDE_DIRS})
target_link_libraries(UnitTests PRIVATE ${GTEST_BOTH_LIBRARIES})
target_link_libraries(UnitTests PRIVATE hip::host hip::device hsa-runtime64::hsa-runtime64)
add_executable(rccl-UnitTests ${COMMON_SOURCE_FILES} ${TEST_SOURCE_FILES})
configure_file(common/UnitTests UnitTests)
target_include_directories(rccl-UnitTests PRIVATE ${ROCM_PATH} ${GTEST_INCLUDE_DIRS})
target_link_libraries(rccl-UnitTests PRIVATE ${GTEST_BOTH_LIBRARIES})
target_link_libraries(rccl-UnitTests PRIVATE hip::host hip::device hsa-runtime64::hsa-runtime64)
# UnitTests using static library of rccl requires passing rccl
# rccl-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} -lrocm_smi64 -L${ROCM_PATH}/lib -L${ROCM_PATH}/rocm_smi/lib)
add_dependencies(rccl-UnitTests rccl)
target_link_libraries(rccl-UnitTests PRIVATE dl rt numa -lrccl -L${CMAKE_BINARY_DIR} -lrocm_smi64 -L${ROCM_PATH}/lib -L${ROCM_PATH}/rocm_smi/lib)
else()
target_link_libraries(UnitTests PRIVATE rccl)
target_link_libraries(rccl-UnitTests PRIVATE rccl)
endif()
# HIPCC adds /opt/rocm/lib as RPATH, even though the install process is supposed to
# remove RPATH. It also occurs before any user-specified rpath, which effectively overrides the user rpath.
# As a work-around, set the correct RPATH for the unit test executable as a post-install step
# As a work-around, set the correct RPATH for the rccl unit test executable as a post-install step
# if (CMAKE_INSTALL_PREFIX MATCHES "${ROCM_PATH}")
# # install_prefix/CMAKE_INSTALL_PREFIX was not explicitly specified, so look in build/release
# add_custom_command( TARGET UnitTests POST_BUILD COMMAND chrpath ARGS -r ${CMAKE_BINARY_DIR}:${ROCM_PATH}/lib ${CMAKE_BINARY_DIR}/test/UnitTests)
# add_custom_command( TARGET rccl-UnitTests POST_BUILD COMMAND chrpath ARGS -r ${CMAKE_BINARY_DIR}:${ROCM_PATH}/lib ${CMAKE_BINARY_DIR}/test/rccl-UnitTests)
# else()
# add_custom_command( TARGET UnitTests POST_BUILD COMMAND chrpath ARGS -r ${CMAKE_INSTALL_PREFIX}/lib:${ROCM_PATH}/lib ${CMAKE_INSTALL_PREFIX}/test/UnitTests)
# add_custom_command( TARGET rccl-UnitTests POST_BUILD COMMAND chrpath ARGS -r ${CMAKE_INSTALL_PREFIX}/lib:${ROCM_PATH}/lib ${CMAKE_INSTALL_PREFIX}/test/rccl-UnitTests)
# endif()
set_property(TARGET UnitTests PROPERTY INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib;${ROCM_PATH}/lib;${CMAKE_BINARY_DIR}")
set_property(TARGET UnitTests PROPERTY BUILD_RPATH "${CMAKE_BINARY_DIR};${ROCM_PATH}/lib")
rocm_install(TARGETS UnitTests COMPONENT tests)
set_property(TARGET rccl-UnitTests PROPERTY INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib;${ROCM_PATH}/lib;${CMAKE_BINARY_DIR}")
set_property(TARGET rccl-UnitTests PROPERTY BUILD_RPATH "${CMAKE_BINARY_DIR};${ROCM_PATH}/lib")
rocm_install(TARGETS rccl-UnitTests COMPONENT tests)
else()
message("Not building unit tests")
message("Not building rccl unit tests")
endif()
Fichier exécutable
+10
Voir le fichier
@@ -0,0 +1,10 @@
#/*************************************************************************
# * Copyright (c) 2022 Advanced Micro Devices, Inc. All rights reserved.
# *
# * See LICENSE.txt for license information
# ************************************************************************/
#!/bin/bash
echo "The RCCL test client name has changed from UnitTests to rccl-UnitTests. Please make sure to execute the rccl-UnitTests instead."
./rccl-UnitTests $@