-
Notifications
You must be signed in to change notification settings - Fork 91
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
43 lines (33 loc) · 1.46 KB
/
CMakeLists.txt
File metadata and controls
43 lines (33 loc) · 1.46 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT license.
# Find required packages
find_package(MPI REQUIRED)
# Note: nlohmann_json::nlohmann_json target is already available from the main project
# Set up common libraries and includes for tests
set(PERF_TEST_LIBS_COMMON mscclpp ${GPU_LIBRARIES} ${NUMA_LIBRARIES} Threads::Threads MPI::MPI_CXX)
if(IBVERBS_FOUND)
list(APPEND PERF_TEST_LIBS_COMMON ${IBVERBS_LIBRARIES})
endif()
set(PERF_TEST_INC_COMMON
PRIVATE ${PROJECT_SOURCE_DIR}/include
SYSTEM PRIVATE ${GPU_INCLUDE_DIRS})
# Function to add a test executable
function(add_perf_test_executable name sources)
if(MSCCLPP_USE_ROCM)
set_source_files_properties(${sources} PROPERTIES LANGUAGE CXX)
endif()
add_executable(${name} ${sources})
target_link_libraries(${name} ${PERF_TEST_LIBS_COMMON})
# Link nlohmann_json - use the target from main project
target_link_libraries(${name} nlohmann_json::nlohmann_json)
if(IBVERBS_FOUND)
target_compile_definitions(${name} PRIVATE USE_IBVERBS)
endif()
target_include_directories(${name} ${PERF_TEST_INC_COMMON})
target_compile_definitions(${name} PRIVATE MSCCLPP_USE_MPI_FOR_TESTS)
# Set C++ standard
target_compile_features(${name} PRIVATE cxx_std_17)
endfunction()
# Add FIFO test
add_perf_test_executable(fifo_test "framework.cc;fifo_test.cu")
add_perf_test_executable(fifo_test_multi_gpu "framework.cc;fifo_test_multi_gpu.cu")