2020-01-15 17:54:27 -07:00
|
|
|
# Copyright (c) 2019-2020 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)")
|
|
|
|
|
|
2020-08-06 09:36:58 -06:00
|
|
|
include_directories(${GTEST_INCLUDE_DIRS})
|
|
|
|
|
|
2019-07-05 15:43:00 -07:00
|
|
|
# Collect source files for tests
|
|
|
|
|
set(TEST_SOURCES
|
|
|
|
|
test_AllGather.cpp
|
|
|
|
|
test_AllReduce.cpp
|
|
|
|
|
test_Broadcast.cpp
|
|
|
|
|
test_Reduce.cpp
|
|
|
|
|
test_ReduceScatter.cpp
|
|
|
|
|
test_GroupCalls.cpp
|
|
|
|
|
test_CombinedCalls.cpp
|
|
|
|
|
test_AllReduceAbort.cpp
|
|
|
|
|
test_BroadcastAbort.cpp
|
2020-04-28 16:26:42 -07:00
|
|
|
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
|
|
|
)
|
|
|
|
|
|
|
|
|
|
add_executable(UnitTests ${TEST_SOURCES})
|
2020-08-06 09:36:58 -06:00
|
|
|
target_include_directories(UnitTests PRIVATE /opt/rocm ${GTEST_INCLUDE_DIRS})
|
2020-08-31 16:10:09 +00:00
|
|
|
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()
|
2019-07-05 15:43:00 -07:00
|
|
|
else()
|
|
|
|
|
message("Not building unit tests")
|
|
|
|
|
endif()
|