Dosyalar
rocm-systems/examples/rccl/CMakeLists.txt
T
Jonathan R. Madsen f147670a7a Various optimizations (#192)
* CDash name prefix {{ repo_owner }}-{{ ref_name }}

- remove /merge from CI name

* disable using BFD when sampling_include_inlines is OFF

- this consumes a lot of memory

* Improve finalization of rocprofiler

* update timemory submodule

- disable OMPT thread begin/end callbacks
- support hierarchies in signal handlers
- update operation::pop_node debugging
- settings_update_type + setting_supported_data_types
- fixed parsing args in timemory_init

* Improve timemory build time

* Remove kokkosp restrictions for perfetto

* omnitrace exe signal handler update

- configure signal handlers before main to allow libomnitrace to override

* Backtrace and timemory submodule updates

- Use unwind::cache w/o inline info
- update timemory submodule
  - unwind::cache updates
  - filepath updates
  - fix termination_signal_message
  - fix vsettings::report_change

* Update dyninst submodule

- updates BinaryEdit::getResolvedLibraryPath

* update timemory submodule

- update CpuArch support

* Cleanup configure warnings

* Update examples cmake and workflows

- (Mostly) eliminate configuration warnings

* omnitrace exe updates

- pass environ to BPatch::processCreate
- avoid trailing ":" in DYNINST_REWRITER_PATHS

* Update dyninst submodule

- Add flags to DyninstOptimization.cmake
- Remove strtok from BinaryEdit::getResolvedLibraryPath

* examples/mpi CMakeLists.txt update

- STATUS message about missing MPI during CI, otherwise AUTHOR_WARNING

* Dev build and linker flags

- use -gsplit-dwarf when OMNITRACE_BUILD_DEVELOPER is ON
  - disable when OMNITRACE_BUILD_NUMBER > 1
- OMNITRACE_BUILD_LINKER option
- add -fuse-ld=${OMNITRACE_BUILD_LINKER}
- omnitrace_add_cache_option function

* Update workflows to set OMNITRACE_BUILD_NUMBER

* Fix generator expressions for -fuse-ld

* Suppress some configuration warnings during CI

- helps to keep track of real warnings when they arise

* Update timemory and dyninst submodules with CMP0135

* Add -V flag to run-ci script
2022-11-01 17:28:12 -05:00

89 satır
3.1 KiB
CMake

cmake_minimum_required(VERSION 3.16 FATAL_ERROR)
project(omnitrace-rccl-example LANGUAGES CXX)
if(OMNITRACE_DISABLE_EXAMPLES)
get_filename_component(_DIR ${CMAKE_CURRENT_LIST_DIR} NAME)
if(${PROJECT_NAME} IN_LIST OMNITRACE_DISABLE_EXAMPLES OR ${_DIR} IN_LIST
OMNITRACE_DISABLE_EXAMPLES)
return()
endif()
endif()
function(rccl_message _MSG_TYPE)
if("${CMAKE_PROJECT_NAME}" STREQUAL "omnitrace"
AND "$ENV{OMNITRACE_CI}"
AND "${_MSG_TYPE}" MATCHES "WARNING")
set(_MSG_TYPE STATUS) # don't generate warnings during CI
endif()
if("${CMAKE_PROJECT_NAME}" STREQUAL "omnitrace")
omnitrace_message(${_MSG_TYPE} ${ARGN})
else()
message(${_MSG_TYPE} ${ARGN})
endif()
endfunction()
find_package(hip HINTS ${ROCmVersion_DIR} PATHS ${ROCmVersion_DIR})
if(NOT hip_FOUND)
rccl_message(AUTHOR_WARNING "${PROJECT_NAME} skipped. Missing HIP...")
return()
endif()
if("${CMAKE_PROJECT_NAME}" STREQUAL "omnitrace" AND "$ENV{OMNITRACE_CI}")
find_package(rccl QUIET) # avoid generating warning in CI
else()
find_package(rccl)
endif()
if(NOT rccl_FOUND)
rccl_message(AUTHOR_WARNING "${PROJECT_NAME} skipped. Missing RCCL...")
return()
endif()
if(hip_FOUND AND rccl_FOUND)
include(FetchContent)
fetchcontent_declare(
rccl-tests GIT_REPOSITORY https://github.com/ROCmSoftwarePlatform/rccl-tests.git)
# After the following call, the CMake targets defined by googletest and Catch2 will be
# available to the rest of the build
fetchcontent_populate(rccl-tests)
get_filename_component(rccl_ROOT_DIR "${rccl_INCLUDE_DIR}" DIRECTORY)
rccl_message(STATUS "Building rccl-tests...")
execute_process(
COMMAND make HIP_HOME=${ROCM_PATH} RCCL_HOME=${rccl_ROOT_DIR}
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/_deps/rccl-tests-src
RESULT_VARIABLE _RCCL_BUILD_RET
ERROR_VARIABLE _RCCL_BUILD_ERR
OUTPUT_VARIABLE _RCCL_BUILD_OUT
OUTPUT_STRIP_TRAILING_WHITESPACE ERROR_STRIP_TRAILING_WHITESPACE)
if(NOT _RCCL_BUILD_RET EQUAL 0)
rccl_message(${_RCCL_BUILD_OUT})
rccl_message(AUTHOR_WARNING "Failed to build rccl-tests: ${_RCCL_BUILD_ERR}")
else()
file(GLOB RCCL_TEST_EXECUTABLES
${CMAKE_BINARY_DIR}/_deps/rccl-tests-src/build/*_perf)
set(_RCCL_TEST_TARGETS)
foreach(_EXE ${RCCL_TEST_EXECUTABLES})
get_filename_component(_EXE_NAME "${_EXE}" NAME)
execute_process(COMMAND ${CMAKE_COMMAND} -E copy ${_EXE}
${CMAKE_CURRENT_BINARY_DIR}/${_EXE_NAME})
add_executable(rccl-tests::${_EXE_NAME} IMPORTED GLOBAL)
set_property(
TARGET rccl-tests::${_EXE_NAME}
PROPERTY IMPORTED_LOCATION ${CMAKE_CURRENT_BINARY_DIR}/${_EXE_NAME})
list(APPEND _RCCL_TEST_TARGETS "rccl-tests::${_EXE_NAME}")
endforeach()
set(RCCL_TEST_TARGETS
"${_RCCL_TEST_TARGETS}"
CACHE INTERNAL "rccl-test targets")
endif()
endif()