File tree 4 files changed +31
-2
lines changed
include/traccc/definitions
4 files changed +31
-2
lines changed Original file line number Diff line number Diff line change 35
35
- name : CPU
36
36
container : ghcr.io/acts-project/ubuntu2404:48
37
37
cxx_standard : " 20"
38
- options : -DTRACCC_USE_ROOT=FALSE
38
+ options : -DTRACCC_USE_ROOT=FALSE -DTRACCC_ENFORCE_CONCEPTS=TRUE
39
39
- name : HIP
40
40
container : ghcr.io/acts-project/ubuntu2004_rocm:47
41
41
cxx_standard : " 17"
47
47
- name : CUDA
48
48
container : ghcr.io/acts-project/ubuntu2204_cuda:48
49
49
cxx_standard : " 20"
50
- options : -DTRACCC_BUILD_CUDA=TRUE -DTRACCC_USE_ROOT=FALSE
50
+ options : -DTRACCC_BUILD_CUDA=TRUE -DTRACCC_USE_ROOT=FALSE -DTRACCC_ENFORCE_CONCEPTS=TRUE
51
51
- name : SYCL
52
52
container : ghcr.io/acts-project/ubuntu2004_oneapi:47
53
53
cxx_standard : " 17"
Original file line number Diff line number Diff line change @@ -66,6 +66,9 @@ option( TRACCC_BUILD_EXAMPLES "Build the examples of traccc" TRUE )
66
66
option ( TRACCC_USE_SYSTEM_LIBS "Use system libraries be default" FALSE )
67
67
option ( TRACCC_USE_ROOT "Use ROOT in the build (if needed)" TRUE )
68
68
69
+ # Flag enforcing concept usage.
70
+ option ( TRACCC_ENFORCE_CONCEPTS "Throw an error if concepts are not available" FALSE )
71
+
69
72
# Clean up.
70
73
unset ( TRACCC_BUILD_CUDA_DEFAULT )
71
74
Original file line number Diff line number Diff line change @@ -110,3 +110,11 @@ target_link_libraries( traccc_core
110
110
# CUDA or HIP backend with SYCL.
111
111
target_compile_definitions ( traccc_core
112
112
PUBLIC $<$<COMPILE_LANGUAGE:SYCL>:EIGEN_NO_CUDA EIGEN_NO_HIP> )
113
+
114
+ if ( TRACCC_ENFORCE_CONCEPTS )
115
+ target_compile_definitions (
116
+ traccc_core
117
+ PUBLIC
118
+ TRACCC_ENFORCE_CONCEPTS
119
+ )
120
+ endif ()
Original file line number Diff line number Diff line change
1
+ /* *
2
+ * traccc library, part of the ACTS project (R&D line)
3
+ *
4
+ * (c) 2024 CERN for the benefit of the ACTS project
5
+ *
6
+ * Mozilla Public License Version 2.0
7
+ */
8
+
9
+ #pragma once
10
+
11
+ #if __cpp_concepts >= 201907L
12
+ #define TRACCC_CONSTRAINT (...) __VA_ARGS__
13
+ #elif defined(TRACCC_ENFORCE_CONCEPTS)
14
+ #error \
15
+ " `TRACCC_ENFORCE_CONCEPTS` is set, but concepts are not available. This constitutes a fatal error."
16
+ #else
17
+ #define TRACCC_CONSTRAINT (...) __VA_ARGS__
18
+ #endif
You can’t perform that action at this time.
0 commit comments