From b5be1ef2d195f3fd2ba97661633f6e558a1ebc7b Mon Sep 17 00:00:00 2001 From: kimwalisch Date: Thu, 4 Apr 2024 17:35:20 +0200 Subject: [PATCH] Fix preprocessor logic --- src/PrimeGenerator.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/PrimeGenerator.cpp b/src/PrimeGenerator.cpp index 38b815ebe..31e05af13 100644 --- a/src/PrimeGenerator.cpp +++ b/src/PrimeGenerator.cpp @@ -47,6 +47,9 @@ #elif defined(MULTIARCH_TARGET_AVX512) && \ __has_include() #include + +#else // Default portable algorithm + #define DEFAULT_CPU_ARCH #endif namespace { @@ -403,6 +406,9 @@ void PrimeGenerator::fillPrevPrimes(Vector& 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 @@ -467,6 +473,8 @@ void PrimeGenerator::fillNextPrimes(Vector& primes, while (*size == 0); } +#endif + #if defined(HAS_AVX512) || \ defined(MULTIARCH_TARGET_AVX512)