From: Martin Kronbichler Date: Mon, 28 Aug 2017 15:18:46 +0000 (+0200) Subject: Improve detection of vectorization features. X-Git-Tag: v9.0.0-rc1~1154^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c934c67822626cc70250e6b44f00dbeb88019a2f;p=dealii.git Improve detection of vectorization features. --- 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.