Skip to content

Commit

Permalink
Fix preprocessor logic
Browse files Browse the repository at this point in the history
  • Loading branch information
kimwalisch committed Apr 4, 2024
1 parent 023d3ad commit b5be1ef
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/PrimeGenerator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,9 @@
#elif defined(MULTIARCH_TARGET_AVX512) && \
__has_include(<immintrin.h>)
#include <immintrin.h>

#else // Default portable algorithm
#define DEFAULT_CPU_ARCH
#endif

namespace {
Expand Down Expand Up @@ -403,6 +406,9 @@ void PrimeGenerator::fillPrevPrimes(Vector<uint64_t>& primes,
}
}

#if defined(DEFAULT_CPU_ARCH) || \
defined(MULTIARCH_TARGET_DEFAULT)

/// This method is used by iterator::next_prime().
/// This method stores only the next few primes (~ 1000) in the
/// primes vector. Also for iterator::next_prime() there is no
Expand Down Expand Up @@ -467,6 +473,8 @@ void PrimeGenerator::fillNextPrimes(Vector<uint64_t>& primes,
while (*size == 0);
}

#endif

#if defined(HAS_AVX512) || \
defined(MULTIARCH_TARGET_AVX512)

Expand Down

0 comments on commit b5be1ef

Please sign in to comment.