]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Improve detection of vectorization features. 4978/head
authorMartin Kronbichler <kronbichler@lnm.mw.tum.de>
Mon, 28 Aug 2017 15:18:46 +0000 (17:18 +0200)
committerMartin Kronbichler <kronbichler@lnm.mw.tum.de>
Mon, 28 Aug 2017 15:58:18 +0000 (17:58 +0200)
cmake/checks/check_01_cpu_features.cmake
include/deal.II/base/vectorization.h

index 37b6e2e6a05330699effe99c1c2c45af7640953b..1a9f20d66211ee713c959355c2114cc80ef3c874 100644 (file)
@@ -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 <immintrin.h>
     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 <immintrin.h>
     int main()
     {
index f68c9add59998bc0bed41c5753fbac8b3f314816..d5154d85f8af376bd1966b981f3af72dc83fa779 100644 (file)
@@ -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.

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.