From c934c67822626cc70250e6b44f00dbeb88019a2f Mon Sep 17 00:00:00 2001 From: Martin Kronbichler Date: Mon, 28 Aug 2017 17:18:46 +0200 Subject: [PATCH] Improve detection of vectorization features. --- cmake/checks/check_01_cpu_features.cmake | 6 ++++++ include/deal.II/base/vectorization.h | 5 +---- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/cmake/checks/check_01_cpu_features.cmake b/cmake/checks/check_01_cpu_features.cmake index 37b6e2e6a0..1a9f20d662 100644 --- a/cmake/checks/check_01_cpu_features.cmake +++ b/cmake/checks/check_01_cpu_features.cmake @@ -117,6 +117,9 @@ IF(DEAL_II_ALLOW_PLATFORM_INTROSPECTION) # CHECK_CXX_SOURCE_RUNS( " + #ifndef __AVX__ + #error \"__AVX__ flag not set, no support for AVX\" + #endif #include class VectorizedArray { @@ -173,6 +176,9 @@ IF(DEAL_II_ALLOW_PLATFORM_INTROSPECTION) CHECK_CXX_SOURCE_RUNS( " + #ifndef __AVX512F__ + #error \"__AVX512F__ flag not set, no support for AVX512\" + #endif #include int main() { diff --git a/include/deal.II/base/vectorization.h b/include/deal.II/base/vectorization.h index f68c9add59..d5154d85f8 100644 --- a/include/deal.II/base/vectorization.h +++ b/include/deal.II/base/vectorization.h @@ -39,9 +39,6 @@ // 'check_01_cpu_features.cmake', ensures that these feature are not only // present in the compilation unit but also working properly. -#if DEAL_II_COMPILER_VECTORIZATION_LEVEL >= 1 && !defined(__SSE2__) -#error "Mismatch in vectorization capabilities: SSE2 was detected during configuration of deal.II and switched on, but it is apparently not available for the file you are trying to compile at the moment. Check compilation flags controlling the instruction set, such as -march=native." -#endif #if DEAL_II_COMPILER_VECTORIZATION_LEVEL >= 2 && !defined(__AVX__) #error "Mismatch in vectorization capabilities: AVX was detected during configuration of deal.II and switched on, but it is apparently not available for the file you are trying to compile at the moment. Check compilation flags controlling the instruction set, such as -march=native." #endif @@ -2045,7 +2042,7 @@ vectorized_transpose_and_store(const bool add_into, // for safety, also check that __SSE2__ is defined in case the user manually // set some conflicting compile flags which prevent compilation -#elif DEAL_II_COMPILER_VECTORIZATION_LEVEL >= 1 && defined(__SSE2__) +#elif DEAL_II_COMPILER_VECTORIZATION_LEVEL >= 1 /** * Specialization for double and SSE2. -- 2.39.5