2025-08-21 15:56:47 -04:00
|
|
|
cmake_minimum_required(VERSION 3.21 FATAL_ERROR)
|
2023-01-24 18:53:23 -06:00
|
|
|
|
2024-10-15 11:20:40 -04:00
|
|
|
project(rocprofiler-systems-causal-example LANGUAGES CXX)
|
2023-01-24 18:53:23 -06:00
|
|
|
|
2024-10-15 11:20:40 -04:00
|
|
|
if(ROCPROFSYS_DISABLE_EXAMPLES)
|
2023-01-24 18:53:23 -06:00
|
|
|
get_filename_component(_DIR ${CMAKE_CURRENT_LIST_DIR} NAME)
|
|
|
|
|
|
2025-06-22 10:44:33 -04:00
|
|
|
if(
|
|
|
|
|
${PROJECT_NAME} IN_LIST ROCPROFSYS_DISABLE_EXAMPLES
|
|
|
|
|
OR ${_DIR} IN_LIST ROCPROFSYS_DISABLE_EXAMPLES
|
|
|
|
|
)
|
2023-01-24 18:53:23 -06:00
|
|
|
return()
|
|
|
|
|
endif()
|
|
|
|
|
endif()
|
|
|
|
|
|
|
|
|
|
set(CMAKE_BUILD_TYPE "Release")
|
|
|
|
|
find_package(Threads REQUIRED)
|
2024-10-15 11:20:40 -04:00
|
|
|
if(NOT TARGET rocprofiler-systems::rocprofiler-systems-user-library)
|
|
|
|
|
find_package(rocprofiler-systems REQUIRED COMPONENTS user)
|
2023-01-24 18:53:23 -06:00
|
|
|
endif()
|
|
|
|
|
|
|
|
|
|
add_library(causal-interface-library INTERFACE)
|
2025-06-22 10:44:33 -04:00
|
|
|
target_compile_options(
|
|
|
|
|
causal-interface-library
|
|
|
|
|
INTERFACE -g3 -gdwarf-3 -fno-omit-frame-pointer
|
|
|
|
|
)
|
|
|
|
|
target_link_libraries(
|
|
|
|
|
causal-interface-library
|
|
|
|
|
INTERFACE Threads::Threads ${CMAKE_DL_LIBS}
|
|
|
|
|
)
|
2023-01-24 18:53:23 -06:00
|
|
|
|
2024-10-15 11:20:40 -04:00
|
|
|
rocprofiler_systems_causal_example_executable(
|
2023-01-24 18:53:23 -06:00
|
|
|
"causal-both"
|
|
|
|
|
SOURCES causal.cpp impl.cpp
|
|
|
|
|
LINK_LIBRARIES causal-interface-library
|
2025-06-22 10:44:33 -04:00
|
|
|
DEFINITIONS USE_RNG=1 USE_CPU=1
|
|
|
|
|
)
|
2023-01-24 18:53:23 -06:00
|
|
|
|
2024-10-15 11:20:40 -04:00
|
|
|
rocprofiler_systems_causal_example_executable(
|
2023-01-24 18:53:23 -06:00
|
|
|
"causal-rng"
|
|
|
|
|
SOURCES causal.cpp impl.cpp
|
|
|
|
|
LINK_LIBRARIES causal-interface-library
|
2025-06-22 10:44:33 -04:00
|
|
|
DEFINITIONS USE_RNG=1 USE_CPU=0
|
|
|
|
|
)
|
2023-01-24 18:53:23 -06:00
|
|
|
|
2024-10-15 11:20:40 -04:00
|
|
|
rocprofiler_systems_causal_example_executable(
|
2023-01-24 18:53:23 -06:00
|
|
|
"causal-cpu"
|
|
|
|
|
SOURCES causal.cpp impl.cpp
|
|
|
|
|
LINK_LIBRARIES causal-interface-library
|
2025-06-22 10:44:33 -04:00
|
|
|
DEFINITIONS USE_RNG=0 USE_CPU=1
|
|
|
|
|
)
|