Skip to content

Commit

Permalink
Check __AVX512__ macro
Browse files Browse the repository at this point in the history
  • Loading branch information
kimwalisch committed Apr 4, 2024
1 parent c2dd191 commit 4ee88fb
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
7 changes: 4 additions & 3 deletions include/primesieve/PrimeGenerator.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,10 @@
#include <cstddef>

#if defined(MULTIARCH_AVX512)
#if defined(__AVX512F__) && \
defined(__AVX512VBMI__) && \
defined(__AVX512VBMI2__)
#if defined(__AVX512__) || \
(defined(__AVX512F__) && \
defined(__AVX512VBMI__) && \
defined(__AVX512VBMI2__))
// GCC/Clang function multiversioning for AVX512 is not needed if
// the user compiles with -mavx512f -mavx512vbmi -mavx512vbmi2.
// GCC/Clang function multiversioning generally causes a minor
Expand Down
9 changes: 5 additions & 4 deletions src/PrimeGenerator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,11 @@
#include <limits>

// x86-64 AVX512
#if defined(__AVX512F__) && \
defined(__AVX512VBMI__) && \
defined(__AVX512VBMI2__) && \
__has_include(<immintrin.h>)
#if __has_include(<immintrin.h>) && \
(defined(__AVX512__) || \
(defined(__AVX512F__) && \
defined(__AVX512VBMI__) && \
defined(__AVX512VBMI2__)))
#include <immintrin.h>
#define HAS_AVX512_VBMI2

Expand Down

0 comments on commit 4ee88fb

Please sign in to comment.