-
Notifications
You must be signed in to change notification settings - Fork 34
/
CMakeLists.txt
276 lines (254 loc) · 13.6 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
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
set(ARBORX_DEVICE_TYPES)
if(Kokkos_ENABLE_SERIAL)
list(APPEND ARBORX_DEVICE_TYPES Kokkos::Serial::device_type)
endif()
if(Kokkos_ENABLE_OPENMP)
list(APPEND ARBORX_DEVICE_TYPES Kokkos::OpenMP::device_type)
endif()
if(Kokkos_ENABLE_CUDA)
list(APPEND ARBORX_DEVICE_TYPES Kokkos::CudaSpace::device_type)
endif()
if(Kokkos_ENABLE_THREADS)
list(APPEND ARBORX_DEVICE_TYPES Kokkos::Threads::device_type)
endif()
if(Kokkos_ENABLE_HIP)
list(APPEND ARBORX_DEVICE_TYPES Kokkos::HIPSpace::device_type)
endif()
if(Kokkos_ENABLE_OPENMPTARGET)
list(APPEND ARBORX_DEVICE_TYPES Kokkos::Experimental::OpenMPTarget::device_type)
endif()
if(Kokkos_ENABLE_SYCL)
list(APPEND ARBORX_DEVICE_TYPES Kokkos::Experimental::SYCL::device_type)
endif()
string(REPLACE ";" "," ARBORX_DEVICE_TYPES "${ARBORX_DEVICE_TYPES}")
if(NOT ARBORX_DEVICE_TYPES)
message(SEND_ERROR "Kokkos_DEVICES must include at least one of 'SERIAL', 'OPENMP', 'CUDA', 'HIP', 'OPENMPTARGET', 'SYCL' or 'THREADS'!")
endif()
configure_file(ArborX_EnableDeviceTypes.hpp.in ${CMAKE_CURRENT_BINARY_DIR}/ArborX_EnableDeviceTypes.hpp @ONLY)
find_package(Boost 1.67.0 REQUIRED COMPONENTS unit_test_framework)
if(Kokkos_ENABLE_CUDA AND Boost_VERSION VERSION_GREATER 1.68 AND Boost_VERSION VERSION_LESS 1.75)
message(WARNING "Boost versions 1.69 to 1.74 are known to yield build issues with NVCC")
endif()
# Compile only, nothing to run
add_executable(ArborX_Test_CompileOnly.exe
tstCompileOnlyAccessTraits.cpp
tstCompileOnlyCallbacks.cpp
tstCompileOnlyTypeRequirements.cpp
tstCompileOnlyWeightedEdges.cpp
tstCompileOnlyMain.cpp
)
target_link_libraries(ArborX_Test_CompileOnly.exe PRIVATE ArborX)
add_executable(ArborX_Test_DetailsUtils.exe
tstAttachIndices.cpp
tstDetailsVector.cpp
tstDetailsUtils.cpp
tstDetailsKokkosExtStdAlgorithms.cpp
tstDetailsKokkosExtMinMaxReduce.cpp
tstDetailsKokkosExtViewHelpers.cpp
utf_main.cpp
)
# TODO link Boost::dynamic_linking interface target to enable dynamic linking
# (adds BOOST_ALL_DYN_LINK)
target_link_libraries(ArborX_Test_DetailsUtils.exe PRIVATE ArborX Boost::unit_test_framework)
target_compile_definitions(ArborX_Test_DetailsUtils.exe PRIVATE BOOST_TEST_DYN_LINK)
target_include_directories(ArborX_Test_DetailsUtils.exe PRIVATE ${CMAKE_CURRENT_BINARY_DIR})
add_test(NAME ArborX_Test_DetailsUtils COMMAND ArborX_Test_DetailsUtils.exe)
add_executable(ArborX_Test_Geometry.exe
tstDetailsAlgorithms.cpp
tstCompileOnlyGeometry.cpp
tstRay.cpp
tstKDOP.cpp
)
target_link_libraries(ArborX_Test_Geometry.exe PRIVATE ArborX Boost::unit_test_framework)
target_compile_definitions(ArborX_Test_Geometry.exe PRIVATE BOOST_TEST_DYN_LINK)
target_include_directories(ArborX_Test_Geometry.exe PRIVATE ${CMAKE_CURRENT_BINARY_DIR})
add_test(NAME ArborX_Test_Geometry COMMAND ArborX_Test_Geometry.exe)
set(ARBORX_TEST_QUERY_TREE_SOURCES)
foreach(_test Callbacks Degenerate ManufacturedSolution ComparisonWithBoost)
file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/tstQueryTree${_test}_BVH.cpp.tmp"
"#include <ArborX_LinearBVH.hpp>\n"
"#include <ArborX_Box.hpp>\n"
"#include \"ArborXTest_LegacyTree.hpp\"\n"
"template <class MemorySpace>\n"
"using ArborX_BVH_Box = ArborX::BVH<MemorySpace>;\n"
"template <class MemorySpace>\n"
"using ArborX_Legacy_BVH_Box =\n"
" LegacyTree<ArborX::BoundingVolumeHierarchy<\n"
" MemorySpace, ArborX::PairValueIndex<ArborX::Box>,\n"
" ArborX::Details::DefaultIndexableGetter, ArborX::Box>>;\n"
"#define ARBORX_TEST_TREE_TYPES Tuple<ArborX_BVH_Box, ArborX_Legacy_BVH_Box>\n"
"#define ARBORX_TEST_DEVICE_TYPES std::tuple<${ARBORX_DEVICE_TYPES}>\n"
"#include <tstQueryTree${_test}.cpp>\n"
)
configure_file(
"${CMAKE_CURRENT_BINARY_DIR}/tstQueryTree${_test}_BVH.cpp.tmp"
"${CMAKE_CURRENT_BINARY_DIR}/tstQueryTree${_test}_BVH.cpp" COPYONLY
)
list(APPEND ARBORX_TEST_QUERY_TREE_SOURCES "${CMAKE_CURRENT_BINARY_DIR}/tstQueryTree${_test}_BVH.cpp")
file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/tstQueryTree${_test}_BF.cpp.tmp"
"#include <ArborX_BruteForce.hpp>\n"
"#include <ArborX_Box.hpp>\n"
"#include \"ArborXTest_LegacyTree.hpp\"\n"
"template <class MemorySpace>\n"
"using ArborX_BruteForce_Box = ArborX::BruteForce<MemorySpace>;\n"
"template <class MemorySpace>\n"
"using ArborX_Legacy_BruteForce_Box =\n"
" LegacyTree<ArborX::BruteForce<\n"
" MemorySpace, ArborX::PairValueIndex<ArborX::Box>,\n"
" ArborX::Details::DefaultIndexableGetter, ArborX::Box>>;\n"
"#define ARBORX_TEST_TREE_TYPES Tuple<ArborX_BruteForce_Box, ArborX_Legacy_BruteForce_Box>\n"
"#define ARBORX_TEST_DEVICE_TYPES std::tuple<${ARBORX_DEVICE_TYPES}>\n"
"#define ARBORX_TEST_DISABLE_CALLBACK_EARLY_EXIT\n"
"#include <tstQueryTree${_test}.cpp>\n"
)
configure_file(
"${CMAKE_CURRENT_BINARY_DIR}/tstQueryTree${_test}_BF.cpp.tmp"
"${CMAKE_CURRENT_BINARY_DIR}/tstQueryTree${_test}_BF.cpp" COPYONLY
)
list(APPEND ARBORX_TEST_QUERY_TREE_SOURCES "${CMAKE_CURRENT_BINARY_DIR}/tstQueryTree${_test}_BF.cpp")
foreach(_bounding_volume KDOP14 KDOP18) # purposefully ommitting KDOP6 and KDOP26 to reduce the number of instantiations
file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/tstQueryTree${_test}_BVH_${_bounding_volume}.cpp.tmp"
"#include <ArborX_LinearBVH.hpp>\n"
"#include <ArborX_KDOP.hpp>\n"
"#include \"ArborXTest_LegacyTree.hpp\"\n"
"using KDOP6 = ArborX::Experimental::KDOP<6>;\n"
"using KDOP14 = ArborX::Experimental::KDOP<14>;\n"
"using KDOP18 = ArborX::Experimental::KDOP<18>;\n"
"using KDOP26 = ArborX::Experimental::KDOP<26>;\n"
"template <class MemorySpace>\n"
"using ArborX_Legacy_BVH_${_bounding_volume} =\n"
" LegacyTree<ArborX::BoundingVolumeHierarchy<\n"
" MemorySpace, ArborX::PairValueIndex<${_bounding_volume}>,\n"
" ArborX::Details::DefaultIndexableGetter, ${_bounding_volume}>>;\n"
"#define ARBORX_TEST_TREE_TYPES Tuple<ArborX_Legacy_BVH_${_bounding_volume}>\n"
"#define ARBORX_TEST_DEVICE_TYPES std::tuple<${ARBORX_DEVICE_TYPES}>\n"
"#define ARBORX_TEST_DISABLE_NEAREST_QUERY\n"
"#define ARBORX_TEST_DISABLE_SPATIAL_QUERY_INTERSECTS_SPHERE\n"
"#include <tstQueryTree${_test}.cpp>\n"
)
configure_file(
"${CMAKE_CURRENT_BINARY_DIR}/tstQueryTree${_test}_BVH_${_bounding_volume}.cpp.tmp"
"${CMAKE_CURRENT_BINARY_DIR}/tstQueryTree${_test}_BVH_${_bounding_volume}.cpp" COPYONLY
)
list(APPEND ARBORX_TEST_QUERY_TREE_SOURCES "${CMAKE_CURRENT_BINARY_DIR}/tstQueryTree${_test}_BVH_${_bounding_volume}.cpp")
endforeach()
endforeach()
list(APPEND ARBORX_TEST_QUERY_TREE_SOURCES
tstQueryTreeCallbackQueryPerThread.cpp
tstQueryTreeRay.cpp
tstQueryTreeTraversalPolicy.cpp
tstQueryTreeIntersectsKDOP.cpp
tstKokkosToolsAnnotations.cpp
utf_main.cpp
)
add_executable(ArborX_Test_QueryTree.exe ${ARBORX_TEST_QUERY_TREE_SOURCES})
target_link_libraries(ArborX_Test_QueryTree.exe PRIVATE ArborX Boost::unit_test_framework)
target_compile_definitions(ArborX_Test_QueryTree.exe PRIVATE BOOST_TEST_DYN_LINK)
# FIXME_SYCL oneDPL messes with namespace std, see https://github.com/oneapi-src/oneDPL/issues/576
# only needed for the tools annotation test
if(Kokkos_ENABLE_SYCL)
target_compile_definitions(ArborX_Test_QueryTree.exe PRIVATE NANORANGE_NO_STD_FORWARD_DECLARATIONS)
endif()
target_include_directories(ArborX_Test_QueryTree.exe PRIVATE ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR})
add_test(NAME ArborX_Test_QueryTree COMMAND ArborX_Test_QueryTree.exe)
add_executable(ArborX_Test_DetailsTreeConstruction.exe
tstDetailsMortonCodes.cpp
tstDetailsTreeConstruction.cpp
tstIndexableGetter.cpp
utf_main.cpp
)
target_link_libraries(ArborX_Test_DetailsTreeConstruction.exe PRIVATE ArborX Boost::unit_test_framework)
target_compile_definitions(ArborX_Test_DetailsTreeConstruction.exe PRIVATE BOOST_TEST_DYN_LINK)
target_include_directories(ArborX_Test_DetailsTreeConstruction.exe PRIVATE ${CMAKE_CURRENT_BINARY_DIR})
add_test(NAME ArborX_Test_DetailsTreeConstruction COMMAND ArborX_Test_DetailsTreeConstruction.exe)
add_executable(ArborX_Test_DetailsContainers.exe
tstSequenceContainers.cpp
tstContainerAdaptors.cpp
tstHeapOperations.cpp
tstPriorityQueueMiscellaneous.cpp
)
target_link_libraries(ArborX_Test_DetailsContainers.exe PRIVATE ArborX Boost::unit_test_framework)
target_compile_definitions(ArborX_Test_DetailsContainers.exe PRIVATE BOOST_TEST_DYN_LINK)
add_test(NAME ArborX_Test_DetailsContainers COMMAND ArborX_Test_DetailsContainers.exe)
add_executable(ArborX_Test_DetailsCrsGraphWrapperImpl.exe tstDetailsCrsGraphWrapperImpl.cpp utf_main.cpp)
target_link_libraries(ArborX_Test_DetailsCrsGraphWrapperImpl.exe PRIVATE ArborX Boost::unit_test_framework)
target_compile_definitions(ArborX_Test_DetailsCrsGraphWrapperImpl.exe PRIVATE BOOST_TEST_DYN_LINK)
target_include_directories(ArborX_Test_DetailsCrsGraphWrapperImpl.exe PRIVATE ${CMAKE_CURRENT_BINARY_DIR})
add_test(NAME ArborX_Test_DetailsCrsGraphWrapperImpl COMMAND ArborX_Test_DetailsCrsGraphWrapperImpl.exe)
add_executable(ArborX_Test_Clustering.exe
tstDBSCAN.cpp
tstDendrogram.cpp
utf_main.cpp
)
target_link_libraries(ArborX_Test_Clustering.exe PRIVATE ArborX Boost::unit_test_framework)
target_compile_definitions(ArborX_Test_Clustering.exe PRIVATE BOOST_TEST_DYN_LINK)
target_include_directories(ArborX_Test_Clustering.exe PRIVATE ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_SOURCE_DIR}/benchmarks/dbscan)
add_test(NAME ArborX_Test_Clustering COMMAND ArborX_Test_Clustering.exe)
# compare results with a dataset of 1000 points from mlpack
configure_file(
${CMAKE_CURRENT_SOURCE_DIR}/mst_golden_test_points.csv
${CMAKE_CURRENT_BINARY_DIR}/mst_golden_test_points.csv
COPYONLY
)
configure_file(
${CMAKE_CURRENT_SOURCE_DIR}/mst_golden_test_edges.csv
${CMAKE_CURRENT_BINARY_DIR}/mst_golden_test_edges.csv
COPYONLY
)
add_executable(ArborX_Test_DetailsClusteringHelpers.exe
tstDetailsTreeNodeLabeling.cpp
tstDetailsMutualReachabilityDistance.cpp
tstMinimumSpanningTree.cpp
tstMinimumSpanningTreeGoldenTest.cpp
tstUnionFind.cpp
utf_main.cpp
)
target_link_libraries(ArborX_Test_DetailsClusteringHelpers.exe PRIVATE ArborX Boost::unit_test_framework)
target_compile_definitions(ArborX_Test_DetailsClusteringHelpers.exe PRIVATE BOOST_TEST_DYN_LINK)
target_include_directories(ArborX_Test_DetailsClusteringHelpers.exe PRIVATE ${CMAKE_CURRENT_BINARY_DIR})
add_test(NAME ArborX_Test_DetailsClusteringHelpers COMMAND ArborX_Test_DetailsClusteringHelpers.exe)
add_executable(ArborX_Test_SpecializedTraversals.exe
tstDetailsHalfTraversal.cpp
tstDetailsExpandHalfToFull.cpp
tstNeighborList.cpp
utf_main.cpp
)
target_link_libraries(ArborX_Test_SpecializedTraversals.exe PRIVATE ArborX Boost::unit_test_framework)
target_compile_definitions(ArborX_Test_SpecializedTraversals.exe PRIVATE BOOST_TEST_DYN_LINK)
target_include_directories(ArborX_Test_SpecializedTraversals.exe PRIVATE ${CMAKE_CURRENT_BINARY_DIR})
add_test(NAME ArborX_Test_SpecializedTraversals COMMAND ArborX_Test_SpecializedTraversals.exe)
if(ARBORX_ENABLE_MPI)
add_executable(ArborX_Test_DistributedTree.exe tstDistributedTree.cpp tstKokkosToolsDistributedAnnotations.cpp utf_main.cpp)
target_link_libraries(ArborX_Test_DistributedTree.exe PRIVATE ArborX Boost::unit_test_framework)
target_compile_definitions(ArborX_Test_DistributedTree.exe PRIVATE BOOST_TEST_DYN_LINK ARBORX_MPI_UNIT_TEST)
# FIXME_SYCL oneDPL messes with namespace std, see https://github.com/oneapi-src/oneDPL/issues/576
# only needed for the tools annotation test
if(Kokkos_ENABLE_SYCL)
target_compile_definitions(ArborX_Test_DistributedTree.exe PRIVATE NANORANGE_NO_STD_FORWARD_DECLARATIONS)
endif()
target_include_directories(ArborX_Test_DistributedTree.exe PRIVATE ${CMAKE_CURRENT_BINARY_DIR})
add_test(NAME ArborX_Test_DistributedTree COMMAND ${MPIEXEC_EXECUTABLE} ${MPIEXEC_NUMPROC_FLAG} ${MPIEXEC_MAX_NUMPROCS} ${MPIEXEC_PREFLAGS} $<TARGET_FILE:ArborX_Test_DistributedTree.exe> ${MPIEXEC_POSTFLAGS})
add_executable(ArborX_Test_DetailsDistributedTreeImpl.exe tstDetailsDistributedTreeImpl.cpp utf_main.cpp)
target_link_libraries(ArborX_Test_DetailsDistributedTreeImpl.exe PRIVATE ArborX Boost::unit_test_framework)
target_compile_definitions(ArborX_Test_DetailsDistributedTreeImpl.exe PRIVATE BOOST_TEST_DYN_LINK ARBORX_MPI_UNIT_TEST)
target_include_directories(ArborX_Test_DetailsDistributedTreeImpl.exe PRIVATE ${CMAKE_CURRENT_BINARY_DIR})
add_test(NAME ArborX_Test_DetailsDistributedTreeImpl COMMAND ${MPIEXEC_EXECUTABLE} ${MPIEXEC_NUMPROC_FLAG} ${MPIEXEC_MAX_NUMPROCS} ${MPIEXEC_PREFLAGS} $<TARGET_FILE:ArborX_Test_DetailsDistributedTreeImpl.exe> ${MPIEXEC_POSTFLAGS})
endif()
add_executable(ArborX_Test_BoostAdapters.exe tstBoostGeometryAdapters.cpp tstBoostRangeAdapters.cpp utf_main.cpp)
target_link_libraries(ArborX_Test_BoostAdapters.exe PRIVATE ArborX Boost::unit_test_framework)
target_compile_definitions(ArborX_Test_BoostAdapters.exe PRIVATE BOOST_TEST_DYN_LINK)
add_test(NAME ArborX_Test_BoostAdapters COMMAND ArborX_Test_BoostAdapters.exe)
add_executable(ArborX_Test_InterpMovingLeastSquares.exe
tstInterpDetailsSVD.cpp
tstInterpDetailsCompactRadialBasisFunction.cpp
tstInterpDetailsPolyBasis.cpp
tstInterpDetailsMLSCoefficients.cpp
tstInterpMovingLeastSquares.cpp
utf_main.cpp)
target_link_libraries(ArborX_Test_InterpMovingLeastSquares.exe PRIVATE ArborX Boost::unit_test_framework)
target_compile_definitions(ArborX_Test_InterpMovingLeastSquares.exe PRIVATE BOOST_TEST_DYN_LINK)
target_include_directories(ArborX_Test_InterpMovingLeastSquares.exe PRIVATE ${CMAKE_CURRENT_BINARY_DIR})
add_test(NAME ArborX_Test_InterpMovingLeastSquares COMMAND ArborX_Test_InterpMovingLeastSquares.exe)
if(ARBORX_ENABLE_HEADER_SELF_CONTAINMENT_TESTS)
add_subdirectory(headers_self_contained)
endif()