-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
418 lines (325 loc) · 12.2 KB
/
CMakeLists.txt
File metadata and controls
418 lines (325 loc) · 12.2 KB
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
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
#
# Copyright 2021 Huawei Technologies Co., Ltd.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# write here the name of the category
# add_grb_executables and add_grb_executable_custom need this information
set( TEST_CATEGORY "unit" )
# list tests, without the CATEROR[IES,Y] keyword (it's now passed via TEST_CATEGORY)
add_grb_executables( equals equals.cpp
BACKENDS reference NO_BACKEND_NAME
)
add_grb_executables( add15d add15d.cpp
BACKENDS reference NO_BACKEND_NAME
)
add_grb_executables( add15m add15m.cpp
BACKENDS reference NO_BACKEND_NAME
)
add_grb_executables( argmax argmax.cpp
BACKENDS reference reference_omp bsp1d hybrid hyperdags nonblocking
)
add_grb_executables( argmin argmin.cpp
BACKENDS reference reference_omp bsp1d hybrid hyperdags nonblocking
)
add_grb_executables( buildVector buildVector.cpp
BACKENDS reference reference_omp bsp1d hybrid hyperdags nonblocking
)
add_grb_executables( clearMatrix clearMatrix.cpp
BACKENDS reference reference_omp bsp1d hybrid hyperdags nonblocking
)
add_grb_executables( compareParserTest parser.cpp
BACKENDS reference NO_BACKEND_NAME
COMPILE_DEFINITIONS COMPARE
)
add_grb_executables( copyAndAssignVectorIterator copyAndAssignVectorIterator.cpp
BACKENDS reference reference_omp bsp1d hybrid hyperdags nonblocking
)
add_grb_executables( copyVector copyVector.cpp
BACKENDS reference reference_omp bsp1d hybrid hyperdags nonblocking
)
add_grb_executables( distribution_bsp1d distribution_bsp1d.cpp
BACKENDS reference NO_BACKEND_NAME
)
add_grb_executables( distribution_matrix_bsp1d distribution_matrix_bsp1d.cpp
BACKENDS bsp1d NO_BACKEND_NAME
ADDITIONAL_LINK_LIBRARIES test_utils
)
add_grb_executables( distribution distribution.cpp
BACKENDS bsp1d NO_BACKEND_NAME
)
add_grb_executables( id id.cpp
BACKENDS reference reference_omp bsp1d hybrid hyperdags nonblocking
)
add_grb_executables( id_distributed id_distributed.cpp
BACKENDS bsp1d hybrid
)
add_grb_executables( dot dot.cpp
BACKENDS reference reference_omp bsp1d hybrid hyperdags nonblocking
)
add_grb_executables( emptyVector emptyVector.cpp
BACKENDS reference reference_omp bsp1d hybrid hyperdags nonblocking
)
add_grb_executables( ewiseapply ewiseapply.cpp
BACKENDS reference reference_omp bsp1d hybrid hyperdags nonblocking
)
add_grb_executables( eWiseMatrix eWiseMatrix.cpp
BACKENDS reference reference_omp bsp1d hybrid hyperdags nonblocking
)
add_grb_executables( collectives_blas0 auto_launcher.cpp
launcher/collectives_blas0.cpp
BACKENDS reference reference_omp bsp1d hybrid hyperdags nonblocking
)
add_grb_executables( fold_to_scalar auto_launcher.cpp
launcher/reduce.cpp
BACKENDS reference reference_omp bsp1d hybrid hyperdags nonblocking
)
add_grb_executables( fork_launcher fork_launcher.cpp
BACKENDS bsp1d NO_BACKEND_NAME
)
add_grb_executable_custom( hpparser ${ALP_UTILS_SRC_PATH}/hpparser.c
LINK_LIBRARIES backend_headers_nodefs OpenMP::OpenMP_C
COMPILE_DEFINITIONS TEST_HPPARSER _GNU_SOURCE _DEBUG
)
add_grb_executables( masked_mxv masked_mxv.cpp
BACKENDS reference reference_omp hyperdags nonblocking
)
add_grb_executables( masked_vxm masked_vxm.cpp
BACKENDS reference reference_omp hyperdags nonblocking
)
add_grb_executables( matrixIterator matrixIterator.cpp
BACKENDS reference reference_omp bsp1d hybrid hyperdags nonblocking
ADDITIONAL_LINK_LIBRARIES test_utils_headers
)
add_grb_executables( fold_matrix_to_scalar fold_matrix_to_scalar.cpp
BACKENDS reference reference_omp bsp1d hybrid hyperdags nonblocking
)
add_grb_executables( doubleAssign doubleAssign.cpp
BACKENDS reference reference_omp bsp1d hybrid hyperdags nonblocking
)
add_grb_executables( matrixSet matrixSet.cpp
BACKENDS reference reference_omp bsp1d hybrid hyperdags nonblocking
)
add_grb_executables( setMatrixValue setMatrixValue.cpp
BACKENDS reference reference_omp bsp1d hybrid hyperdags nonblocking
)
add_grb_executables( moveVector moveVector.cpp
BACKENDS reference reference_omp hyperdags bsp1d hybrid nonblocking
)
add_grb_executables( mul15i mul15i.cpp
BACKENDS reference NO_BACKEND_NAME
)
add_grb_executables( mul15m mul15m.cpp
BACKENDS reference NO_BACKEND_NAME
)
add_grb_executables( eWiseMul eWiseMul.cpp
BACKENDS reference reference_omp bsp1d hybrid hyperdags nonblocking
)
add_grb_executables( factories factories.cpp
BACKENDS reference reference_omp bsp1d hybrid hyperdags nonblocking
)
add_grb_executables( muladd muladd.cpp
BACKENDS reference reference_omp bsp1d hybrid hyperdags nonblocking
)
add_grb_executables( mxm mxm.cpp
BACKENDS reference reference_omp hyperdags nonblocking #bsp1d hybrid
ADDITIONAL_LINK_LIBRARIES test_utils
)
add_grb_executables( mxm_crs mxm.cpp
BACKENDS reference reference_omp
ADDITIONAL_LINK_LIBRARIES test_utils
COMPILE_DEFINITIONS TEST_CRS_ONLY
)
add_grb_executables( parserTest utilParserTest.cpp
BACKENDS reference NO_BACKEND_NAME
COMPILE_DEFINITIONS COMPARE
)
add_grb_executables( iteratorFilter iteratorFilter.cpp
BACKENDS reference NO_BACKEND_NAME
)
add_grb_executables( monoids monoids.cpp
BACKENDS reference NO_BACKEND_NAME
)
add_grb_executables( semirings semirings.cpp
BACKENDS reference NO_BACKEND_NAME
)
add_grb_executables( RBGaussSeidel RBGaussSeidel.cpp
BACKENDS reference reference_omp bsp1d hybrid hyperdags nonblocking
)
add_grb_executables( selectMatrix selectMatrix.cpp
BACKENDS reference reference_omp bsp1d hybrid hyperdags nonblocking
ADDITIONAL_LINK_LIBRARIES test_utils_headers
)
add_grb_executables( set set.cpp
BACKENDS reference reference_omp bsp1d hybrid hyperdags nonblocking
)
add_grb_executables( setToIndex setToIndex.cpp
BACKENDS reference reference_omp bsp1d hybrid hyperdags nonblocking
)
add_grb_executables( sparse_mxv sparse_mxv.cpp
BACKENDS reference reference_omp bsp1d hybrid hyperdags nonblocking
)
add_grb_executables( sparse_vxm sparse_vxm.cpp
BACKENDS reference reference_omp bsp1d hybrid hyperdags nonblocking
)
add_grb_executables( stdVector stdVector.cpp
BACKENDS reference reference_omp bsp1d hybrid hyperdags nonblocking
)
add_grb_executables( swapVector swapVector.cpp
BACKENDS reference reference_omp bsp1d hybrid hyperdags nonblocking
)
add_grb_executables( thread_local_storage thread_local_storage.cpp
BACKENDS reference NO_BACKEND_NAME
ADDITIONAL_LINK_LIBRARIES Threads::Threads
)
add_grb_executables( vectorToMatrix vectorToMatrix.cpp
BACKENDS reference reference_omp bsp1d hybrid hyperdags nonblocking
)
add_grb_executables( vmxa vmxa.cpp
BACKENDS reference reference_omp bsp1d hyperdags nonblocking
)
add_grb_executables( vmx vmx.cpp
BACKENDS reference reference_omp bsp1d hyperdags nonblocking
)
add_grb_executables( zip zip.cpp
BACKENDS reference reference_omp bsp1d hybrid hyperdags nonblocking
)
add_grb_executables( copyVoidMatrices copyVoidMatrices.cpp
BACKENDS reference reference_omp bsp1d hybrid hyperdags nonblocking
)
add_grb_executables( copyMixedDomainsMatrices copyMixedDomainsMatrices.cpp
BACKENDS reference reference_omp bsp1d hybrid hyperdags nonblocking
)
add_grb_executables( masked_muladd masked_muladd.cpp
BACKENDS reference reference_omp bsp1d hybrid hyperdags nonblocking
)
add_grb_executables( spy spy.cpp
BACKENDS reference reference_omp hyperdags nonblocking
)
add_grb_executables( dense_spmv dense_spmv.cpp
BACKENDS reference reference_omp bsp1d hybrid hyperdags nonblocking
)
add_grb_executables( illegal_spmv illegal_spmv.cpp
BACKENDS reference reference_omp bsp1d hybrid hyperdags nonblocking
)
add_grb_executables( moveMatrix moveMatrix.cpp
BACKENDS reference reference_omp bsp1d hybrid hyperdags nonblocking
)
add_grb_executables( stdMatrix stdMatrix.cpp
BACKENDS reference reference_omp bsp1d hybrid hyperdags nonblocking
)
add_grb_executables( eWiseApply_matrix eWiseApply_matrix.cpp
BACKENDS reference reference_omp bsp1d hybrid hyperdags nonblocking
)
# in the below, test_utils_headers is retained in case CMake is configured to
# include _DEBUG flags
add_grb_executables( eWiseApplyMatrixReference eWiseApplyMatrixReference.cpp
BACKENDS reference reference_omp hyperdags nonblocking
ADDITIONAL_LINK_LIBRARIES test_utils_headers
)
add_grb_executables( eWiseLambda eWiseLambda.cpp
BACKENDS reference reference_omp hyperdags nonblocking
)
add_grb_executables( outer outer.cpp
BACKENDS reference reference_omp hyperdags nonblocking
)
# must generate the golden output for other tests
force_add_grb_executable( mxv mxv.cpp
BACKEND reference
)
add_grb_executables( mxv mxv.cpp
BACKENDS reference_omp bsp1d hybrid hyperdags nonblocking
)
# must generate the golden output for other tests
force_add_grb_executable( vxm vxm.cpp
BACKEND reference
)
add_grb_executables( vxm vxm.cpp
BACKENDS reference_omp bsp1d hybrid hyperdags nonblocking
)
add_grb_executables( capacity capacity.cpp
BACKENDS reference reference_omp bsp1d hybrid hyperdags nonblocking
)
add_grb_executables( wait wait.cpp
BACKENDS reference reference_omp bsp1d hybrid hyperdags nonblocking
)
add_grb_executables( buildMatrixUnique buildMatrixUnique.cpp
BACKENDS reference reference_omp bsp1d hybrid hyperdags nonblocking
ADDITIONAL_LINK_LIBRARIES test_utils
)
add_grb_executables( pinnedVector pinnedVector.cpp
BACKENDS reference reference_omp bsp1d hybrid hyperdags nonblocking
)
add_grb_executables( parallelRegularIterators parallelRegularIterators.cpp
BACKENDS reference reference_omp hyperdags nonblocking bsp1d hybrid
)
add_grb_executables( adapterIterator adapterIterator.cpp
BACKENDS reference reference_omp hyperdags nonblocking bsp1d hybrid
)
add_grb_executables( vectorFromListConstructor vectorFromListConstructor.cpp
BACKENDS reference reference_omp bsp1d hybrid hyperdags nonblocking
)
# the below targets test successfully when they compile -- they do not need to
# be executed successfully as part of the unit test suite.
add_grb_executables( properties static_asserts/properties.cpp
BACKENDS reference reference_omp bsp1d hybrid hyperdags nonblocking
)
add_grb_executables( matrix_type static_asserts/matrix.cpp
BACKENDS reference reference_omp bsp1d hybrid hyperdags nonblocking
)
add_grb_executables( launch_benchmark_auto launcherAndBenchmarker.cpp
BACKENDS bsp1d hybrid
COMPILE_DEFINITIONS DISTRIBUTED_EXECUTION
)
add_grb_executables( launch_benchmark_auto launcherAndBenchmarker.cpp
BACKENDS reference reference_omp hyperdags nonblocking
)
add_grb_executables( launch_benchmark_frommpi_manual launcherAndBenchmarker.cpp
BACKENDS bsp1d hybrid
COMPILE_DEFINITIONS DISTRIBUTED_EXECUTION NO_LPF_AUTO_INIT
)
add_grb_executables( launch_benchmark_frommpi_manual launcherAndBenchmarker.cpp
BACKENDS reference reference_omp hyperdags nonblocking
COMPILE_DEFINITIONS NO_LPF_AUTO_INIT
)
# targets to list and build the test for this category
get_property( unit_tests_list GLOBAL PROPERTY tests_category_unit )
add_custom_target( "list_tests_category_unit"
COMMAND echo "${unit_tests_list}"
COMMAND_EXPAND_LISTS
)
add_custom_target( "build_tests_category_unit"
DEPENDS "${unit_tests_list}"
)
foreach( mode ${MODES_unit} )
# Removing the prefix
string( SUBSTRING "${MODES_${mode}_suffix}" 1 -1 __mode )
list( APPEND __MODES "${__mode}" )
endforeach()
# target to run the tests in this category by calling the appropriate runner
add_custom_target( tests_unit
COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/unittests.sh
${SCRIPTS_COMMON_ARGS}
"--test-bin-dir" "\"${CMAKE_CURRENT_BINARY_DIR}\""
"--test-out-dir" "\"${CMAKE_CURRENT_BINARY_DIR}/output\""
"--output-verification-dir" "\"${CMAKE_CURRENT_SOURCE_DIR}/output_verification\""
"--test-data-dir" "\"${CMAKE_CURRENT_SOURCE_DIR}/test_data\""
"--modes" "\"${__MODES}\""
WORKING_DIRECTORY "${PROJECT_SOURCE_DIR}"
DEPENDS build_tests_category_unit # add dependency on this target
# to automatically build before running
COMMAND_EXPAND_LISTS
USES_TERMINAL
)
# custom target "unittests" just to keep old naming
add_custom_target( unittests DEPENDS tests_unit )