Files
rocm-systems/test/CMakeLists.txt
T

66 lines
2.3 KiB
CMake
Raw Normal View History

2021-01-15 16:34:36 -07:00
# Copyright (c) 2019-2021 Advanced Micro Devices, Inc. All rights reserved.
2019-07-05 15:43:00 -07:00
cmake_minimum_required(VERSION 2.8.12)
if(BUILD_TESTS)
message("Going to build unit tests (Installed in /test/UnitTests)")
2021-01-15 16:34:36 -07:00
include_directories(${GTEST_INCLUDE_DIRS})
2019-07-05 15:43:00 -07:00
# Collect source files for tests
2021-01-15 16:34:36 -07:00
set(TEST_SOURCES_SINGLE_PROCESS
2019-07-05 15:43:00 -07:00
test_AllGather.cpp
test_AllReduce.cpp
2021-05-06 09:50:07 -06:00
test_AllReduceGroup.cpp
2019-07-05 15:43:00 -07:00
test_Broadcast.cpp
test_Reduce.cpp
test_ReduceScatter.cpp
test_GroupCalls.cpp
test_CombinedCalls.cpp
test_AllReduceAbort.cpp
test_BroadcastAbort.cpp
test_Scatter.cpp
test_Gather.cpp
2020-09-01 22:32:14 +00:00
test_AllToAll.cpp
test_AllToAllv.cpp
2019-07-05 15:43:00 -07:00
)
2021-01-15 16:34:36 -07:00
set(TEST_SOURCES_MULTI_PROCESS
test_AllGatherMultiProcess.cpp
test_AllReduceMultiProcess.cpp
2021-05-06 09:50:07 -06:00
test_AllReduceGroupMultiProcess.cpp
2021-01-15 16:34:36 -07:00
test_AllToAllMultiProcess.cpp
test_BroadcastMultiProcess.cpp
test_CombinedCallsMultiProcess.cpp
test_GatherMultiProcess.cpp
test_GroupCallsMultiProcess.cpp
test_ReduceMultiProcess.cpp
test_ReduceScatterMultiProcess.cpp
test_ScatterMultiProcess.cpp
)
add_executable(UnitTests ${TEST_SOURCES_SINGLE_PROCESS})
target_include_directories(UnitTests PRIVATE ${ROCM_PATH} ${GTEST_INCLUDE_DIRS})
2020-08-31 16:10:09 +00:00
target_link_libraries(UnitTests PRIVATE ${GTEST_BOTH_LIBRARIES})
2021-06-23 09:19:48 -06:00
target_link_libraries(UnitTests PRIVATE hip::host hip::device)
2020-08-31 16:10:09 +00:00
2021-01-15 16:34:36 -07:00
add_executable(UnitTestsMultiProcess ${TEST_SOURCES_MULTI_PROCESS})
target_include_directories(UnitTestsMultiProcess PRIVATE ${ROCM_PATH} ${GTEST_INCLUDE_DIRS})
2021-01-15 16:34:36 -07:00
target_link_libraries(UnitTestsMultiProcess PRIVATE ${GTEST_BOTH_LIBRARIES})
2021-06-23 09:19:48 -06:00
target_link_libraries(UnitTestsMultiProcess PRIVATE hip::host hip::device)
2021-01-15 16:34:36 -07:00
2020-08-31 16:10:09 +00:00
# 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)
2021-07-09 09:35:32 -07:00
target_link_libraries(UnitTests PRIVATE dl rt numa -lrccl -L${CMAKE_BINARY_DIR} -lrocm_smi64 -L${ROCM_PATH}/rocm_smi/lib)
2021-01-15 16:34:36 -07:00
add_dependencies(UnitTestsMultiProcess rccl)
2021-07-09 09:35:32 -07:00
target_link_libraries(UnitTestsMultiProcess PRIVATE dl rt numa -lrccl -L${CMAKE_BINARY_DIR} -lrocm_smi64 -L${ROCM_PATH}/rocm_smi/lib)
2020-08-31 16:10:09 +00:00
else()
target_link_libraries(UnitTests PRIVATE rccl)
2021-01-15 16:34:36 -07:00
target_link_libraries(UnitTestsMultiProcess PRIVATE rt rccl)
2020-08-31 16:10:09 +00:00
endif()
2019-07-05 15:43:00 -07:00
else()
message("Not building unit tests")
endif()