File tree Expand file tree Collapse file tree 4 files changed +14
-19
lines changed Expand file tree Collapse file tree 4 files changed +14
-19
lines changed Original file line number Diff line number Diff line change @@ -77,10 +77,6 @@ include("cmake/fmt.cmake")
77
77
include ("cmake/spdlog.cmake" )
78
78
include ("cmake/toml.cmake" )
79
79
80
- if (SVS_ENABLE_OMP )
81
- include ("cmake/openmp.cmake" )
82
- endif ()
83
-
84
80
add_library (svs_x86_options_base INTERFACE )
85
81
add_library (svs::x86_options_base ALIAS svs_x86_options_base )
86
82
if (CMAKE_SYSTEM_PROCESSOR MATCHES "(x86)|(X86)|(amd64)|(AMD64)" )
Original file line number Diff line number Diff line change @@ -73,11 +73,6 @@ option(SVS_INITIALIZE_LOGGER
73
73
ON # enabled by default
74
74
)
75
75
76
- option (SVS_ENABLE_OMP
77
- "Support OpenMP threadpool."
78
- OFF # disable by default
79
- )
80
-
81
76
#####
82
77
##### Experimental
83
78
#####
@@ -145,12 +140,6 @@ else()
145
140
target_compile_options (${SVS_LIB} INTERFACE -DSVS_INITIALIZE_LOGGER=0 )
146
141
endif ()
147
142
148
- if (SVS_ENABLE_OMP )
149
- target_compile_options (${SVS_LIB} INTERFACE -DSVS_ENABLE_OMP=1 )
150
- else ()
151
- target_compile_options (${SVS_LIB} INTERFACE -DSVS_ENABLE_OMP=0 )
152
- endif ()
153
-
154
143
#####
155
144
##### Helper target to apply relevant compiler optimizations.
156
145
#####
Original file line number Diff line number Diff line change @@ -105,6 +105,16 @@ consteval bool is_one_or_zero(const char* ptr) {
105
105
return std::move (*this ); \
106
106
}
107
107
108
+ // ///
109
+ // /// Optional flags
110
+ // ///
111
+ #if defined(SVS_ENABLE_OMP)
112
+ #define SVS_OMP 1
113
+ #else
114
+ #define SVS_OMP 0
115
+ #endif
116
+
117
+
108
118
// ///
109
119
// /// Intel(R) AVX extensions
110
120
// ///
Original file line number Diff line number Diff line change 26
26
#include < sstream>
27
27
#include < vector>
28
28
29
- SVS_VALIDATE_BOOL_ENV (SVS_ENABLE_OMP );
30
- #if SVS_ENABLE_OMP
29
+ SVS_VALIDATE_BOOL_ENV (SVS_OMP );
30
+ #if SVS_OMP
31
31
#include < omp.h>
32
32
#endif
33
33
@@ -288,8 +288,8 @@ class SwitchNativeThreadPool {
288
288
NativeThreadPool threadpool_;
289
289
};
290
290
291
- SVS_VALIDATE_BOOL_ENV (SVS_ENABLE_OMP );
292
- #if SVS_ENABLE_OMP
291
+ SVS_VALIDATE_BOOL_ENV (SVS_OMP );
292
+ #if SVS_OMP
293
293
// ///
294
294
// /// A thread pool that utilizes OpenMP for multithreading
295
295
// ///
You can’t perform that action at this time.
0 commit comments