-
-
Notifications
You must be signed in to change notification settings - Fork 427
/
CMakeLists.txt
216 lines (179 loc) · 5.83 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
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
# Copyright (c) 2007-2017 Hartmut Kaiser
# Copyright (c) 2011-2012 Bryce Adelstein-Lelbach
#
# Distributed under the Boost Software License, Version 1.0. (See accompanying
# file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
set(tests
apply_colocated
apply_local
apply_local_executor
apply_remote
apply_remote_client
async_cb_colocated
async_cb_remote
async_cb_remote_client
async_continue
async_continue_cb
async_continue_cb_colocated
async_local
async_local_executor
async_remote
async_remote_client
broadcast
broadcast_apply
channel
channel_local
client_then
condition_variable
counting_semaphore
barrier
fold
future
future_ref
future_then
future_then_executor
future_wait
global_spmd_block
local_latch
local_barrier
local_dataflow
local_dataflow_executor
local_dataflow_std_array
local_event
local_mutex
local_promise_allocator
make_future
packaged_action
promise
promise_allocator
reduce
remote_dataflow
remote_latch
run_guarded
shared_future
sliding_semaphore
split_future
split_shared_future
use_allocator
wait_all_std_array
wait_any_std_array
when_all
when_all_std_array
when_any
when_any_std_array
when_some
when_some_std_array
)
if(HPX_WITH_EXECUTOR_COMPATIBILITY)
set(tests ${tests}
apply_local_executor_v1
async_local_executor_v1
future_then_executor_v1
local_dataflow_executor_v1
)
endif()
if(HPX_WITH_AWAIT)
set(tests ${tests} await)
set(await_PARAMETERS THREADS_PER_LOCALITY 4)
endif()
set(apply_colocated_PARAMETERS LOCALITIES 2)
set(apply_local_PARAMETERS THREADS_PER_LOCALITY 4)
set(apply_local_executor_PARAMETERS THREADS_PER_LOCALITY 4)
set(apply_remote_PARAMETERS LOCALITIES 2)
set(apply_remote_client_PARAMETERS LOCALITIES 2)
set(async_cb_colocated_PARAMETERS LOCALITIES 2)
set(async_continue_PARAMETERS LOCALITIES 2)
set(async_continue_cb_PARAMETERS LOCALITIES 2)
set(async_continue_cb_colocated_PARAMETERS LOCALITIES 2)
set(async_local_PARAMETERS THREADS_PER_LOCALITY 4)
set(async_local_executor_PARAMETERS THREADS_PER_LOCALITY 4)
set(async_remote_PARAMETERS LOCALITIES 2)
set(async_remote_client_PARAMETERS LOCALITIES 2)
set(async_cb_remote_PARAMETERS LOCALITIES 2)
set(async_cb_remote_client_PARAMETERS LOCALITIES 2)
set(broadcast_PARAMETERS LOCALITIES 2)
set(broadcast_apply_PARAMETERS LOCALITIES 2)
set(future_PARAMETERS THREADS_PER_LOCALITY 4)
set(future_then_PARAMETERS THREADS_PER_LOCALITY 4)
set(future_then_executor_PARAMETERS THREADS_PER_LOCALITY 4)
set(future_wait_PARAMETERS THREADS_PER_LOCALITY 4)
set(counting_semaphore_PARAMETERS THREADS_PER_LOCALITY 4)
set(local_barrier_PARAMETERS THREADS_PER_LOCALITY 4)
set(sliding_semaphore_PARAMETERS THREADS_PER_LOCALITY 4)
set(local_latch_PARAMETERS THREADS_PER_LOCALITY 4)
set(remote_latch_PARAMETERS LOCALITIES 2)
set(local_dataflow_PARAMETERS THREADS_PER_LOCALITY 4)
set(local_dataflow_executor_PARAMETERS THREADS_PER_LOCALITY 4)
set(remote_dataflow_PARAMETERS THREADS_PER_LOCALITY 4)
set(remote_dataflow_PARAMETERS LOCALITIES 2)
set(local_event_PARAMETERS THREADS_PER_LOCALITY 4)
set(local_mutex_PARAMETERS THREADS_PER_LOCALITY 4)
set(packaged_action_PARAMETERS THREADS_PER_LOCALITY 4)
set(promise_PARAMETERS THREADS_PER_LOCALITY 4)
set(reduce_PARAMETERS LOCALITIES 2)
set(run_guarded_PARAMETERS THREADS_PER_LOCALITY 4)
foreach(test ${tests})
set(sources
${test}.cpp)
source_group("Source Files" FILES ${sources})
set(folder_name "Tests/Unit/LCOs")
string(FIND ${test} "_v1" _is_v1_test)
if(NOT (_is_v1_test EQUAL -1))
set(folder_name "Tests/Unit/LCOs/V1")
endif()
# add example executable
add_hpx_executable(${test}_test
SOURCES ${sources}
${${test}_FLAGS}
EXCLUDE_FROM_ALL
HPX_PREFIX ${HPX_BUILD_PREFIX}
FOLDER ${folder_name})
add_hpx_unit_test("lcos" ${test} ${${test}_PARAMETERS})
# add a custom target for this example
add_hpx_pseudo_target(tests.unit.lcos.${test})
# make pseudo-targets depend on master pseudo-target
add_hpx_pseudo_dependencies(tests.unit.lcos
tests.unit.lcos.${test})
# add dependencies to pseudo-target
add_hpx_pseudo_dependencies(tests.unit.lcos.${test}
${test}_test_exe)
endforeach()
if(HPX_WITH_COMPILE_ONLY_TESTS)
# add compile time tests
set(compile_tests
fail_compile_mutex_move
fail_compile_spinlock_move
fail_compile_spinlock_no_backoff_move
)
set(fail_compile_mutex_move_FLAGS FAILURE_EXPECTED)
set(fail_compile_spinlock_move_FLAGS FAILURE_EXPECTED)
set(fail_compile_spinlock_no_backoff_move_FLAGS FAILURE_EXPECTED)
foreach(compile_test ${compile_tests})
set(sources
${compile_test}.cpp)
add_hpx_unit_compile_test(
"lcos"
${compile_test}
SOURCES ${sources}
${${compile_test}_FLAGS}
FOLDER "Tests/Unit/LCOs/CompileOnly")
# add a custom target for this example
add_hpx_pseudo_target(tests.unit.lcos.${compile_test})
# make pseudo-targets depend on master pseudo-target
add_hpx_pseudo_dependencies(tests.unit.lcos
tests.unit.lcos.${compile_test})
# add dependencies to pseudo-target
add_hpx_pseudo_dependencies(tests.unit.lcos.${compile_test}
"tests.unit.lcos.${compile_test}")
endforeach()
endif()
#########################################################################################
set(subdirs
shared_mutex
)
# add sub directories
foreach(subdir ${subdirs})
add_hpx_pseudo_target(tests.unit.lcos.${subdir}dir)
add_subdirectory(${subdir})
add_hpx_pseudo_dependencies(tests.unit.lcos tests.unit.lcos.${subdir}dir)
endforeach()