b65f8e7605
* Update perfetto args.gn.in
- remove enable_perfetto_tools_trace_to_text (unused)
* core timeout implementation
- requires OMNITRACE_CI=ON
- requires OMNITRACE_CI_TIMEOUT=<sec>
- adds pthread_self and std::this_thread::get_id to thread info
- pthread_create_gotcha stores native handles (pthread_self)
* Testing updates
- improve detection of segfault/failures with PASS_REGEX exists
- add OMNITRACE_CI_TIMEOUT env variable to all tests
* Line-info in releases
- e.g. -g1 + more options to minimize size of debug info
* Fix typo in config exit action message
* OMNITRACE_UNLIKELY around debug/verbose messages
* format fixes
* Overflow tests + capability check
* transpose example update
- link to threads library
* roctracer/rocprofiler update
- in ROCm 5.5.0, cannot include rocprofiler.h and roctracer.h in same file due to conflicting enum defs
- Moved HSA tracing setup/shutdown to component::roctracer
* roctracer update
- fix definition of roctracer::setup when disabled
* Update fork example
- detach threads on main PID
- flush io outputs when printing info
* Update overflow tests
- pass regular expressions
- overflow on PERF_COUNT_SW_CPU_CLOCK event
* fork gotcha update
- use getpid() instead of getppid()
* update fork example
- wait on threads calling fork
* timeout update
- wait on timeout thread to launch before proceeding
[ROCm/rocprofiler-systems commit: 3e2fa69a14]
85 lines
2.6 KiB
CMake
85 lines
2.6 KiB
CMake
cmake_minimum_required(VERSION 3.16 FATAL_ERROR)
|
|
|
|
project(omnitrace-transpose-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()
|
|
|
|
find_package(hip QUIET HINTS ${ROCmVersion_DIR} PATHS ${ROCmVersion_DIR})
|
|
|
|
find_program(
|
|
HIPCC_EXECUTABLE
|
|
NAMES hipcc
|
|
HINTS ${ROCmVersion_DIR} ${ROCM_PATH} ENV ROCM_PATH /opt/rocm
|
|
PATHS ${ROCmVersion_DIR} ${ROCM_PATH} ENV ROCM_PATH /opt/rocm NO_CACHE)
|
|
mark_as_advanced(HIPCC_EXECUTABLE)
|
|
|
|
if(NOT HIPCC_EXECUTABLE)
|
|
message(AUTHOR_WARNING "hipcc could not be found. Cannot build transpose target")
|
|
return()
|
|
endif()
|
|
|
|
if(NOT CMAKE_CXX_COMPILER_IS_HIPCC AND HIPCC_EXECUTABLE)
|
|
if(CMAKE_CXX_COMPILER STREQUAL HIPCC_EXECUTABLE OR "${CMAKE_CXX_COMPILER}" MATCHES
|
|
"hipcc")
|
|
set(CMAKE_CXX_COMPILER_IS_HIPCC
|
|
1
|
|
CACHE BOOL "HIP compiler")
|
|
endif()
|
|
endif()
|
|
|
|
if((NOT CMAKE_CXX_COMPILER_IS_HIPCC OR (NOT CMAKE_CXX_COMPILER_ID MATCHES "Clang"
|
|
AND NOT hip_FOUND))
|
|
AND (NOT COMMAND omnitrace_custom_compilation AND NOT HIPCC_EXECUTABLE))
|
|
message(AUTHOR_WARNING "transpose target could not be built")
|
|
return()
|
|
endif()
|
|
|
|
option(TRANSPOSE_USE_MPI "Enable MPI support in transpose exe" ${TIMEMORY_USE_MPI})
|
|
|
|
find_package(Threads REQUIRED)
|
|
if(TRANSPOSE_USE_MPI)
|
|
find_package(MPI REQUIRED)
|
|
endif()
|
|
|
|
add_executable(transpose transpose.cpp)
|
|
target_link_libraries(transpose PRIVATE Threads::Threads)
|
|
|
|
if(CMAKE_CXX_COMPILER_ID MATCHES "Clang"
|
|
AND NOT CMAKE_CXX_COMPILER_IS_HIPCC
|
|
AND NOT HIPCC_EXECUTABLE)
|
|
target_link_libraries(
|
|
transpose
|
|
PRIVATE $<TARGET_NAME_IF_EXISTS:omnitrace::omnitrace-compile-options>
|
|
$<TARGET_NAME_IF_EXISTS:hip::host> $<TARGET_NAME_IF_EXISTS:hip::device>)
|
|
else()
|
|
target_compile_options(transpose PRIVATE -W -Wall)
|
|
endif()
|
|
|
|
if("${CMAKE_BUILD_TYPE}" MATCHES "Release")
|
|
target_compile_options(transpose PRIVATE -g1)
|
|
endif()
|
|
|
|
if(TRANSPOSE_USE_MPI)
|
|
target_compile_definitions(transpose PRIVATE USE_MPI)
|
|
target_link_libraries(transpose PRIVATE MPI::MPI_C)
|
|
endif()
|
|
|
|
if(NOT CMAKE_CXX_COMPILER_IS_HIPCC AND HIPCC_EXECUTABLE)
|
|
# defined in MacroUtilities.cmake
|
|
omnitrace_custom_compilation(COMPILER ${HIPCC_EXECUTABLE} TARGET transpose)
|
|
endif()
|
|
|
|
if(OMNITRACE_INSTALL_EXAMPLES)
|
|
install(
|
|
TARGETS transpose
|
|
DESTINATION bin
|
|
COMPONENT omnitrace-examples)
|
|
endif()
|