Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 19 additions & 2 deletions CMakeLists.txt
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ option(USE_BLIT_KERNEL "Use Blit/Copy Kernel for IPC communication" OFF)

option(USE_CALIPER "Enable Caliper benchmarking support" OFF)
option(USE_JSONCPP "Enable support for passing a config file" OFF)
option(PRINT_DEBUG "Enable debug output" OFF)


# Create a variable for NCCL path
Expand Down Expand Up @@ -83,15 +84,31 @@ add_subdirectory(CommFunctions) # add subdirectory after all configuration, may

# Add your source files and executable here
add_executable(${PROJECT_NAME} main.cpp)

target_link_libraries(${PROJECT_NAME} PUBLIC CommFunctions commbench_compiler_flags OpenMP::OpenMP_CXX)
add_executable(bench_p2p bench_p2p.cpp)
add_executable(bench_alltoall bench_alltoall.cpp)
add_executable(bench_broadcast bench_broadcast.cpp)
add_executable(bench_gather bench_gather.cpp)

target_link_libraries(${PROJECT_NAME} PUBLIC CommFunctions commbench_compiler_flags)
target_link_libraries(bench_p2p PUBLIC CommFunctions commbench_compiler_flags)
target_link_libraries(bench_alltoall PUBLIC CommFunctions commbench_compiler_flags)
target_link_libraries(bench_broadcast PUBLIC CommFunctions commbench_compiler_flags)
target_link_libraries(bench_gather PUBLIC CommFunctions commbench_compiler_flags)
install(TARGETS ${PROJECT_NAME} DESTINATION bin)
install(DIRECTORY ${PROJECT_SOURCE_DIR}/CommFunctions DESTINATION include FILES_MATCHING PATTERN "*.h")

if (USE_CUDA)
set_source_files_properties(main.cpp PROPERTIES LANGUAGE CUDA)
set_source_files_properties(bench_p2p.cpp PROPERTIES LANGUAGE CUDA)
set_source_files_properties(bench_alltoall.cpp PROPERTIES LANGUAGE CUDA)
set_source_files_properties(bench_broadcast.cpp PROPERTIES LANGUAGE CUDA)
set_source_files_properties(bench_gather.cpp PROPERTIES LANGUAGE CUDA)
elseif (USE_HIP)
set_source_files_properties(main.cpp PROPERTIES LANGUAGE HIP)
set_source_files_properties(bench_p2p.cpp PROPERTIES LANGUAGE HIP)
set_source_files_properties(bench_alltoall.cpp PROPERTIES LANGUAGE HIP)
set_source_files_properties(bench_broadcast.cpp PROPERTIES LANGUAGE HIP)
set_source_files_properties(bench_gather.cpp PROPERTIES LANGUAGE HIP)
endif()

if (USE_JSONCPP)
Expand Down
9 changes: 9 additions & 0 deletions CommFunctions/CMakeLists.txt
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,15 @@
add_library(CommFunctions INTERFACE commbench.h validate.h comm.h util.h)
target_include_directories(CommFunctions INTERFACE ${MPI_CXX_COMPILER_INCLUDE_DIRS})
target_link_libraries(CommFunctions INTERFACE MPI::MPI_CXX OpenMP::OpenMP_CXX)
if (NOT USE_GASNET)
target_compile_definitions(CommFunctions INTERFACE "USE_MPI")
else()
target_compile_definitions(CommFunctions INTERFACE "USE_GASNET")
endif()

if (PRINT_DEBUG)
target_compile_definitions(CommFunctions INTERFACE "PRINT_DEBUG")
endif()

if (USE_GTL)
target_link_libraries(CommFunctions INTERFACE mpi_gtl_hsa)
Expand Down
Loading