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")
7777include ("cmake/spdlog.cmake" )
7878include ("cmake/toml.cmake" )
7979
80- if (SVS_ENABLE_OMP)
81- include ("cmake/openmp.cmake" )
82- endif ()
83-
8480add_library (svs_x86_options_base INTERFACE )
8581add_library (svs::x86_options_base ALIAS svs_x86_options_base)
8682if (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
7373 ON # enabled by default
7474)
7575
76- option (SVS_ENABLE_OMP
77- "Support OpenMP threadpool."
78- OFF # disable by default
79- )
80-
8176#####
8277##### Experimental
8378#####
@@ -145,12 +140,6 @@ else()
145140 target_compile_options (${SVS_LIB} INTERFACE -DSVS_INITIALIZE_LOGGER=0)
146141endif ()
147142
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-
154143#####
155144##### Helper target to apply relevant compiler optimizations.
156145#####
Original file line number Diff line number Diff line change @@ -105,6 +105,16 @@ consteval bool is_one_or_zero(const char* ptr) {
105105 return std::move (*this ); \
106106 }
107107
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+
108118// ///
109119// /// Intel(R) AVX extensions
110120// ///
Original file line number Diff line number Diff line change 2626#include < sstream>
2727#include < vector>
2828
29- SVS_VALIDATE_BOOL_ENV (SVS_ENABLE_OMP );
30- #if SVS_ENABLE_OMP
29+ SVS_VALIDATE_BOOL_ENV (SVS_OMP );
30+ #if SVS_OMP
3131#include < omp.h>
3232#endif
3333
@@ -288,8 +288,8 @@ class SwitchNativeThreadPool {
288288 NativeThreadPool threadpool_;
289289};
290290
291- SVS_VALIDATE_BOOL_ENV (SVS_ENABLE_OMP );
292- #if SVS_ENABLE_OMP
291+ SVS_VALIDATE_BOOL_ENV (SVS_OMP );
292+ #if SVS_OMP
293293// ///
294294// /// A thread pool that utilizes OpenMP for multithreading
295295// ///
You can’t perform that action at this time.
0 commit comments