diff --git a/apps/nccl/CMakeLists.txt b/apps/nccl/CMakeLists.txt index 2432fe562..5e301fb5e 100644 --- a/apps/nccl/CMakeLists.txt +++ b/apps/nccl/CMakeLists.txt @@ -33,3 +33,7 @@ install(TARGETS mscclpp_nccl LIBRARY DESTINATION ${INSTALL_PREFIX}/lib) install(TARGETS mscclpp_nccl_static ARCHIVE DESTINATION ${INSTALL_PREFIX}/lib) + +if(BUILD_TESTS) + add_subdirectory(test) +endif() diff --git a/apps/nccl/test/CMakeLists.txt b/apps/nccl/test/CMakeLists.txt new file mode 100644 index 000000000..c7cfbaa7d --- /dev/null +++ b/apps/nccl/test/CMakeLists.txt @@ -0,0 +1,6 @@ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT license. + +add_executable(nccl_api_test nccl_api_test.cc) +target_link_libraries(nccl_api_test mscclpp ${GPU_LIBRARIES} ${NUMA_LIBRARIES} ${IBVERBS_LIBRARIES} Threads::Threads MPI::MPI_CXX) +target_include_directories(nccl_api_test ${PROJECT_SOURCE_DIR}/include ${PROJECT_SOURCE_DIR}/apps/nccl/include) diff --git a/test/nccl_api_test.cc b/apps/nccl/test/nccl_api_test.cc similarity index 100% rename from test/nccl_api_test.cc rename to apps/nccl/test/nccl_api_test.cc diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 5b236ebfe..0268af1c6 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -3,9 +3,9 @@ find_package(MPI) -set(TEST_LIBS_COMMON mscclpp_nccl mscclpp ${GPU_LIBRARIES} ${NUMA_LIBRARIES} ${IBVERBS_LIBRARIES} Threads::Threads) +set(TEST_LIBS_COMMON mscclpp ${GPU_LIBRARIES} ${NUMA_LIBRARIES} ${IBVERBS_LIBRARIES} Threads::Threads) set(TEST_LIBS_GTEST GTest::gtest_main GTest::gmock_main) -set(TEST_INC_COMMON PRIVATE ${PROJECT_SOURCE_DIR}/include ${PROJECT_SOURCE_DIR}/apps/nccl/include ${GPU_INCLUDE_DIRS}) +set(TEST_INC_COMMON PRIVATE ${PROJECT_SOURCE_DIR}/include ${GPU_INCLUDE_DIRS}) set(TEST_INC_INTERNAL PRIVATE ${PROJECT_SOURCE_DIR}/src/include) if(USE_ROCM) @@ -24,7 +24,6 @@ endfunction() add_test_executable(allgather_test_cpp allgather_test_cpp.cu) add_test_executable(allgather_test_host_offloading allgather_test_host_offloading.cu) add_test_executable(nvls_test nvls_test.cu) -add_test_executable(nccl_api_test nccl_api_test.cc) configure_file(run_mpi_test.sh.in run_mpi_test.sh)