We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 07a0710 commit 9b74a4dCopy full SHA for 9b74a4d
cp-algo/util/simd.hpp
@@ -4,10 +4,16 @@
4
#include <cstdint>
5
#include <cstddef>
6
#include <memory>
7
+#if defined(__x86_64__) && !defined(CP_ALGO_DISABLE_AVX2)
8
+#define CP_ALGO_SIMD_AVX2_TARGET _Pragma("GCC target(\"avx2\")")
9
+#else
10
+#define CP_ALGO_SIMD_AVX2_TARGET
11
+#endif
12
+
13
#define CP_ALGO_SIMD_PRAGMA_PUSH \
14
_Pragma("GCC push_options") \
15
_Pragma("GCC optimize(\"O3,unroll-loops\")") \
- _Pragma("GCC target(\"avx2\")")
16
+ CP_ALGO_SIMD_AVX2_TARGET
17
CP_ALGO_SIMD_PRAGMA_PUSH
18
namespace cp_algo {
19
template<typename T, size_t len>
0 commit comments