-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
109 lines (80 loc) · 1.88 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
cmake_minimum_required(VERSION 3.14)
project(thread-monitoring LANGUAGES CXX CUDA)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE Release)
endif()
#set(CMAKE_CXX_FLAGS "-Wall -Wextra")
set(CMAKE_CXX_FLAGS_DEBUG "-g")
set(CMAKE_CXX_FLAGS_RELEASE "-O3")
include(FetchContent)
FetchContent_Declare(
googletest
GIT_REPOSITORY https://github.com/google/googletest.git
GIT_TAG release-1.12.1
)
set(gtest_force_shared_crt ON CACHE BOOL "" FORCE)
FetchContent_MakeAvailable(googletest)
enable_language(CUDA)
find_package(Threads REQUIRED)
include_directories(include)
add_executable(async_monitoring
async_main.cpp
)
target_link_libraries(async_monitoring PRIVATE Threads::Threads)
add_executable(cuda_monitoring
cuda_main.cpp cuda_computation.cu
)
set_property(TARGET cuda_monitoring PROPERTY CUDA_SEPARABLE_COMPILATION ON)
add_executable(monitoring
monitoring_main.cpp
)
target_link_libraries(monitoring PRIVATE Threads::Threads)
add_executable(statistics
statistics_main.cpp
)
target_link_libraries(statistics PRIVATE Threads::Threads)
## Tests
enable_testing()
add_executable(
test_monitoring
./test/monitoring.cpp
)
target_link_libraries(
test_monitoring
GTest::gtest_main
)
add_executable(
test_main
./test/atomic_state.cpp
./test/wait_notify.cpp
)
target_link_libraries(
test_main
GTest::gtest_main
)
include(GoogleTest)
gtest_discover_tests(test_monitoring)
## Benchmark
find_package(benchmark REQUIRED)
add_executable(
benchmark_monitoring
./benchmark/monitoring_benchmark.cpp
)
target_link_libraries(
benchmark_monitoring
benchmark::benchmark
)
add_executable(
benchmark_general
./benchmark/general_benchmark.cpp
)
target_link_libraries(
benchmark_general
benchmark::benchmark
)
add_executable(shm
examples/shm_main.cpp
)
#target_link_libraries(shm PRIVATE Threads::Threads)