]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Introduce DEAL_II_VECTORIZATION_WIDTH_IN_BITS
authorMartin Kronbichler <kronbichler@lnm.mw.tum.de>
Sat, 21 Mar 2020 16:26:52 +0000 (17:26 +0100)
committerMartin Kronbichler <kronbichler@lnm.mw.tum.de>
Wed, 25 Mar 2020 06:11:23 +0000 (07:11 +0100)
21 files changed:
cmake/checks/check_01_cpu_features.cmake
cmake/configure/configure_vectorization.cmake
cmake/setup_write_config.cmake
examples/step-37/step-37.cc
examples/step-48/step-48.cc
include/deal.II/base/config.h.in
include/deal.II/base/numbers.h
include/deal.II/base/utilities.h
include/deal.II/base/vectorization.h
include/deal.II/matrix_free/evaluation_kernels.h
include/deal.II/matrix_free/vector_access_internal.h
source/base/utilities.cc
source/base/vectorization.cc
source/matrix_free/mapping_info.cc
tests/base/utilities_02b.cc
tests/base/vectorization_10.cc
tests/base/vectorization_11.cc
tests/base/vectorization_13.cc
tests/base/vectorization_14.cc
tests/base/vectorization_15.cc
tests/matrix_free/matrix_vector_faces_26.cc

index 6ed6d6b64cfb4bc8c45158e2dd743173eaacd0a2..8623ff3d15762522e7967a2718615c1d97c861fd 100644 (file)
@@ -29,7 +29,7 @@
 #   DEAL_II_HAVE_AVX512                  *)
 #   DEAL_II_HAVE_ALTIVEC                 *)
 #   DEAL_II_HAVE_OPENMP_SIMD             *)
-#   DEAL_II_COMPILER_VECTORIZATION_LEVEL
+#   DEAL_II_VECTORIZATION_WIDTH_IN_BITS
 #   DEAL_II_OPENMP_SIMD_PRAGMA
 #
 # *)
@@ -277,17 +277,17 @@ ENDIF() # IF DEAL_II_ALLOW_PLATFORM_INTROSPECTION
 #
 
 IF(DEAL_II_HAVE_AVX512)
-  SET(DEAL_II_COMPILER_VECTORIZATION_LEVEL 3)
+  SET(DEAL_II_VECTORIZATION_WIDTH_IN_BITS 512)
 ELSEIF(DEAL_II_HAVE_AVX)
-  SET(DEAL_II_COMPILER_VECTORIZATION_LEVEL 2)
+  SET(DEAL_II_VECTORIZATION_WIDTH_IN_BITS 256)
 ELSEIF(DEAL_II_HAVE_SSE2)
-  SET(DEAL_II_COMPILER_VECTORIZATION_LEVEL 1)
+  SET(DEAL_II_VECTORIZATION_WIDTH_IN_BITS 128)
 ELSE()
-  SET(DEAL_II_COMPILER_VECTORIZATION_LEVEL 0)
+  SET(DEAL_II_VECTORIZATION_WIDTH_IN_BITS 0)
 ENDIF()
 
 IF(DEAL_II_HAVE_ALTIVEC)
-  SET(DEAL_II_COMPILER_VECTORIZATION_LEVEL 1)
+  SET(DEAL_II_VECTORIZATION_WIDTH_IN_BITS 128)
 ENDIF()
 
 #
@@ -297,7 +297,7 @@ ENDIF()
 #
 
 IF(DEAL_II_WITH_CUDA)
-  SET(DEAL_II_COMPILER_VECTORIZATION_LEVEL 0)
+  SET(DEAL_II_VECTORIZATION_WIDTH_IN_BITS 0)
 ENDIF()
 
 #
index aa17a02dbac25a6336af9919e7b86ca612070870..b0c6a78cc4953e608da003e55286cbdbf8a29510 100644 (file)
 SET(DEAL_II_EXPAND_REAL_SCALARS_VECTORIZED "VectorizedArray<double,1>" "VectorizedArray<float,1>")
 SET(DEAL_II_EXPAND_FLOAT_VECTORIZED "VectorizedArray<float,1>")
 
-IF(${DEAL_II_COMPILER_VECTORIZATION_LEVEL} GREATER 0)
+IF(${DEAL_II_VECTORIZATION_WIDTH_IN_BITS} GREATER 0)
    SET(DEAL_II_EXPAND_REAL_SCALARS_VECTORIZED 
       "${DEAL_II_EXPAND_REAL_SCALARS_VECTORIZED}" "VectorizedArray<double,2>" "VectorizedArray<float,4>")
    SET(DEAL_II_EXPAND_FLOAT_VECTORIZED  "${DEAL_II_EXPAND_FLOAT_VECTORIZED}" "VectorizedArray<float,4>")
 ENDIF()
 
-IF((${DEAL_II_COMPILER_VECTORIZATION_LEVEL} GREATER 1) AND ( DEAL_II_HAVE_AVX OR DEAL_II_HAVE_ALTIVEC))
+IF((${DEAL_II_VECTORIZATION_WIDTH_IN_BITS} GREATER 128))
    SET(DEAL_II_EXPAND_REAL_SCALARS_VECTORIZED 
       "${DEAL_II_EXPAND_REAL_SCALARS_VECTORIZED}" "VectorizedArray<double,4>" "VectorizedArray<float,8>")
    SET(DEAL_II_EXPAND_FLOAT_VECTORIZED  "${DEAL_II_EXPAND_FLOAT_VECTORIZED}" "VectorizedArray<float,8>")
 ENDIF()
 
-IF((${DEAL_II_COMPILER_VECTORIZATION_LEVEL} GREATER 2) AND DEAL_II_HAVE_AVX512)
+IF((${DEAL_II_VECTORIZATION_WIDTH_IN_BITS} GREATER 256))
    SET(DEAL_II_EXPAND_REAL_SCALARS_VECTORIZED 
       "${DEAL_II_EXPAND_REAL_SCALARS_VECTORIZED}" "VectorizedArray<double,8>" "VectorizedArray<float,16>")
    SET(DEAL_II_EXPAND_FLOAT_VECTORIZED  "${DEAL_II_EXPAND_FLOAT_VECTORIZED}" "VectorizedArray<float,16>")
index a208022af99b8e9b1f65d12e4e4710e1e769f506..9e71ac6d38d4387aa73a7e2516de881e227bb363 100644 (file)
@@ -156,7 +156,7 @@ ENDIF()
 IF(CMAKE_BUILD_TYPE MATCHES "Debug")
   _detailed("#        DEAL_II_LIBRARIES_DEBUG:      ${BASE_LIBRARIES_DEBUG}\n")
 ENDIF()
-_detailed("#        DEAL_II_COMPILER_VECTORIZATION_LEVEL: ${DEAL_II_COMPILER_VECTORIZATION_LEVEL}\n")
+_detailed("#        DEAL_II_VECTORIZATION_WIDTH_IN_BITS: ${DEAL_II_VECTORIZATION_WIDTH_IN_BITS}\n")
 
 _detailed("#\n")
 
index 05139308615c7a8ead4d05329ed8fbebe4fbc8b1..559ef80ad4bec965dd0c5f8aba185c752d262fc6 100644 (file)
@@ -1157,8 +1157,7 @@ namespace Step37
 
       pcout << "Vectorization over " << n_vect_doubles
             << " doubles = " << n_vect_bits << " bits ("
-            << Utilities::System::get_current_vectorization_level()
-            << "), VECTORIZATION_LEVEL=" << DEAL_II_COMPILER_VECTORIZATION_LEVEL
+            << Utilities::System::get_current_vectorization_level() << ")"
             << std::endl;
     }
 
index 8c79feb1e51a409598beb22adcbc9c7fa704bf17..b511fef931d019133cb293a9b17c84d69e978e47 100644 (file)
@@ -533,8 +533,7 @@ namespace Step48
       const unsigned int n_vect_bits    = 8 * sizeof(double) * n_vect_doubles;
       pcout << "Vectorization over " << n_vect_doubles
             << " doubles = " << n_vect_bits << " bits ("
-            << Utilities::System::get_current_vectorization_level()
-            << "), VECTORIZATION_LEVEL=" << DEAL_II_COMPILER_VECTORIZATION_LEVEL
+            << Utilities::System::get_current_vectorization_level() << ")"
             << std::endl
             << std::endl;
     }
index b98b6a3f416e0a6a36c23f58b8aee161d171b61f..83c967b3170266467c5c7181d0d1cacdf4153163 100644 (file)
  */
 
 #cmakedefine DEAL_II_WORDS_BIGENDIAN
-#define DEAL_II_COMPILER_VECTORIZATION_LEVEL @DEAL_II_COMPILER_VECTORIZATION_LEVEL@
+
+/*
+ * This sets the largest number of vectorization bits detected for the given
+ * compiler flags and hardware (e.g. 256 for AVX on x86-64 architectures) for
+ * use in deal.II's instrinsics-based VectorizedArray class.
+ */
+#define DEAL_II_VECTORIZATION_WIDTH_IN_BITS @DEAL_II_VECTORIZATION_WIDTH_IN_BITS@
+
+/*
+ * Backward compatibility setting
+ */
+#ifdef DEAL_II_COMPILER_HAS_DIAGNOSTIC_PRAGMA
+#  if DEAL_II_VECTORIZATION_WIDTH_IN_BITS == 512
+#  define DEAL_II_COMPILER_VECTORIZATION_LEVEL _Pragma ("GCC warning \"The DEAL_II_COMPILER_VECTORIZATION_LEVEL macro is deprecated\"") 3
+#  elif DEAL_II_VECTORIZATION_WIDTH_IN_BITS == 256
+#  define DEAL_II_COMPILER_VECTORIZATION_LEVEL _Pragma ("GCC warning \"The DEAL_II_COMPILER_VECTORIZATION_LEVEL macro is deprecated\"") 2
+#  elif DEAL_II_VECTORIZATION_WIDTH_IN_BITS == 128
+#  define DEAL_II_COMPILER_VECTORIZATION_LEVEL _Pragma ("GCC warning \"The DEAL_II_COMPILER_VECTORIZATION_LEVEL macro is deprecated\"") 1
+#  else
+#  define DEAL_II_COMPILER_VECTORIZATION_LEVEL _Pragma ("GCC warning \"The DEAL_II_COMPILER_VECTORIZATION_LEVEL macro is deprecated\"")\
+ 0
+#  endif
+#else
+#  if DEAL_II_VECTORIZATION_WIDTH_IN_BITS == 512
+#  define DEAL_II_COMPILER_VECTORIZATION_LEVEL 3
+#  elif DEAL_II_VECTORIZATION_WIDTH_IN_BITS == 256
+#  define DEAL_II_COMPILER_VECTORIZATION_LEVEL 2
+#  elif DEAL_II_VECTORIZATION_WIDTH_IN_BITS == 128
+#  define DEAL_II_COMPILER_VECTORIZATION_LEVEL 1
+#  else
+#  define DEAL_II_COMPILER_VECTORIZATION_LEVEL 0
+#  endif
+#endif
+
 #define DEAL_II_OPENMP_SIMD_PRAGMA @DEAL_II_OPENMP_SIMD_PRAGMA@
 
 
index 6f83910403e770941a73000d02e33b5ff8996ebd..f86bf25fbb150e22e2116f320356acac88e7cc5c 100644 (file)
@@ -81,13 +81,11 @@ namespace internal
      * Maximal vector length of VectorizedArray for double.
      */
     constexpr static unsigned int max_width =
-#if DEAL_II_COMPILER_VECTORIZATION_LEVEL >= 1 && defined(__ALTIVEC__)
-      2;
-#elif DEAL_II_COMPILER_VECTORIZATION_LEVEL >= 3 && defined(__AVX512F__)
+#if DEAL_II_VECTORIZATION_WIDTH_IN_BITS >= 512
       8;
-#elif DEAL_II_COMPILER_VECTORIZATION_LEVEL >= 2 && defined(__AVX__)
+#elif DEAL_II_VECTORIZATION_WIDTH_IN_BITS >= 256
       4;
-#elif DEAL_II_COMPILER_VECTORIZATION_LEVEL >= 1 && defined(__SSE2__)
+#elif DEAL_II_VECTORIZATION_WIDTH_IN_BITS >= 128
       2;
 #else
       1;
@@ -109,13 +107,13 @@ namespace internal
      * Maximal vector length of VectorizedArray for float.
      */
     constexpr static unsigned int max_width =
-#if DEAL_II_COMPILER_VECTORIZATION_LEVEL >= 1 && defined(__ALTIVEC__)
+#if DEAL_II_VECTORIZATION_WIDTH_IN_BITS >= 128 && defined(__ALTIVEC__)
       4;
-#elif DEAL_II_COMPILER_VECTORIZATION_LEVEL >= 3 && defined(__AVX512F__)
+#elif DEAL_II_VECTORIZATION_WIDTH_IN_BITS >= 512 && defined(__AVX512F__)
       16;
-#elif DEAL_II_COMPILER_VECTORIZATION_LEVEL >= 2 && defined(__AVX__)
+#elif DEAL_II_VECTORIZATION_WIDTH_IN_BITS >= 256 && defined(__AVX__)
       8;
-#elif DEAL_II_COMPILER_VECTORIZATION_LEVEL >= 1 && defined(__SSE2__)
+#elif DEAL_II_VECTORIZATION_WIDTH_IN_BITS >= 128 && defined(__SSE2__)
       4;
 #else
       1;
index 0282ce38ae7c09027d2545dc007b8bfdc1900fec..3a16df7d51cab3342c0f6b58d0fd0d881453bb0e 100644 (file)
@@ -812,8 +812,8 @@ namespace Utilities
     get_cpu_load();
 
     /**
-     * Return the current level of vectorization as described by
-     * DEAL_II_COMPILER_VECTORIZATION_LEVEL in vectorization.h as a string. The
+     * Return the instruction set extension for vectorization as described by
+     * DEAL_II_VECTORIZATION_WIDTH_IN_BITS in vectorization.h as a string. The
      * list of possible return values is:
      *
      * <table>
@@ -829,7 +829,7 @@ namespace Utilities
      * </tr>
      * <tr>
      *   <td>1</td>
-     *   <td>SSE2</td>
+     *   <td>SSE2/AltiVec</td>
      *   <td>128</td>
      * </tr>
      * <tr>
index 32ffb2996dbd78ed0d2c8a9453776e07c570a9f7..5a169c4f687475c6877ffc3c70a5a6c97ab47d65 100644 (file)
 #include <cmath>
 
 // Note:
-// The flag DEAL_II_COMPILER_VECTORIZATION_LEVEL is essentially constructed
+// The flag DEAL_II_VECTORIZATION_WIDTH_IN_BITS is essentially constructed
 // according to the following scheme (on x86-based architectures)
 // #ifdef __AVX512F__
-// #define DEAL_II_COMPILER_VECTORIZATION_LEVEL 3
+// #define DEAL_II_VECTORIZATION_WIDTH_IN_BITS 512
 // #elif defined (__AVX__)
-// #define DEAL_II_COMPILER_VECTORIZATION_LEVEL 2
+// #define DEAL_II_VECTORIZATION_WIDTH_IN_BITS 256
 // #elif defined (__SSE2__)
-// #define DEAL_II_COMPILER_VECTORIZATION_LEVEL 1
+// #define DEAL_II_VECTORIZATION_WIDTH_IN_BITS 128
 // #else
-// #define DEAL_II_COMPILER_VECTORIZATION_LEVEL 0
+// #define DEAL_II_VECTORIZATION_WIDTH_IN_BITS 0
 // #endif
-// In addition to checking the flags __AVX__ and __SSE2__, a CMake test,
-// 'check_01_cpu_features.cmake', ensures that these feature are not only
+// In addition to checking the flags __AVX512F__, __AVX__ and __SSE2__, a CMake
+// test, '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 > 0
-
-#  if DEAL_II_COMPILER_VECTORIZATION_LEVEL >= 2 && defined(__SSE2__) && \
+#if DEAL_II_VECTORIZATION_WIDTH_IN_BITS > 0
+
+// These error messages try to detect the case that deal.II was compiled with
+// a wider instruction set extension as the current compilation unit, for
+// example because deal.II was compiled with AVX, but a user project does not
+// add -march=native or similar flags, making it fall to SSE2. This leads to
+// very strange errors as the size of data structures differs between the
+// compiled deal.II code sitting in libdeal_II.so and the user code if not
+// detected. The __SSE2__ flag ensures that we are actually on a x86-64
+// architecture as we do not want to emit the error on another architecture
+// with 256 bit vectors.
+#  if DEAL_II_VECTORIZATION_WIDTH_IN_BITS >= 256 && defined(__SSE2__) && \
     !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
-#  if DEAL_II_COMPILER_VECTORIZATION_LEVEL >= 3 && defined(__SSE2__) && \
+#  if DEAL_II_VECTORIZATION_WIDTH_IN_BITS >= 512 && defined(__SSE2__) && \
     !defined(__AVX512F__)
 #    error \
       "Mismatch in vectorization capabilities: AVX-512F 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."
@@ -925,7 +934,7 @@ vectorized_transpose_and_store(const bool                            add_into,
 // for safety, also check that __AVX512F__ is defined in case the user manually
 // set some conflicting compile flags which prevent compilation
 
-#  if DEAL_II_COMPILER_VECTORIZATION_LEVEL >= 3 && defined(__AVX512F__)
+#  if DEAL_II_VECTORIZATION_WIDTH_IN_BITS >= 512 && defined(__AVX512F__)
 
 /**
  * Specialization of VectorizedArray class for double and AVX-512.
@@ -2125,7 +2134,7 @@ vectorized_transpose_and_store(const bool                        add_into,
 
 #  endif
 
-#  if DEAL_II_COMPILER_VECTORIZATION_LEVEL >= 2 && defined(__AVX__)
+#  if DEAL_II_VECTORIZATION_WIDTH_IN_BITS >= 256 && defined(__AVX__)
 
 /**
  * Specialization of VectorizedArray class for double and AVX.
@@ -3181,7 +3190,7 @@ vectorized_transpose_and_store(const bool                       add_into,
 
 #  endif
 
-#  if DEAL_II_COMPILER_VECTORIZATION_LEVEL >= 1 && defined(__SSE2__)
+#  if DEAL_II_VECTORIZATION_WIDTH_IN_BITS >= 128 && defined(__SSE2__)
 
 /**
  * Specialization for double and SSE2.
@@ -4101,9 +4110,9 @@ vectorized_transpose_and_store(const bool                       add_into,
 
 
 
-#  endif // if DEAL_II_COMPILER_VECTORIZATION_LEVEL > 0 && defined(__SSE2__)
+#  endif // if DEAL_II_VECTORIZATION_WIDTH_IN_BITS > 0 && defined(__SSE2__)
 
-#  if DEAL_II_COMPILER_VECTORIZATION_LEVEL >= 1 && defined(__ALTIVEC__) && \
+#  if DEAL_II_VECTORIZATION_WIDTH_IN_BITS >= 128 && defined(__ALTIVEC__) && \
     defined(__VSX__)
 
 template <>
@@ -4963,7 +4972,7 @@ operator<<(std::ostream &out, const VectorizedArray<Number, width> &p)
  */
 enum class SIMDComparison : int
 {
-#if DEAL_II_COMPILER_VECTORIZATION_LEVEL >= 2 && defined(__AVX__)
+#if DEAL_II_VECTORIZATION_WIDTH_IN_BITS >= 256 && defined(__AVX__)
   equal                 = _CMP_EQ_OQ,
   not_equal             = _CMP_NEQ_OQ,
   less_than             = _CMP_LT_OQ,
@@ -5100,7 +5109,7 @@ compare_and_apply_mask(const VectorizedArray<Number, 1> &left,
 //@}
 
 #ifndef DOXYGEN
-#  if DEAL_II_COMPILER_VECTORIZATION_LEVEL >= 3 && defined(__AVX512F__)
+#  if DEAL_II_VECTORIZATION_WIDTH_IN_BITS >= 512 && defined(__AVX512F__)
 
 template <SIMDComparison predicate>
 DEAL_II_ALWAYS_INLINE inline VectorizedArray<float, 16>
@@ -5134,7 +5143,7 @@ compare_and_apply_mask(const VectorizedArray<double, 8> &left,
 
 #  endif
 
-#  if DEAL_II_COMPILER_VECTORIZATION_LEVEL >= 2 && defined(__AVX__)
+#  if DEAL_II_VECTORIZATION_WIDTH_IN_BITS >= 256 && defined(__AVX__)
 
 template <SIMDComparison predicate>
 DEAL_II_ALWAYS_INLINE inline VectorizedArray<float, 8>
@@ -5171,7 +5180,7 @@ compare_and_apply_mask(const VectorizedArray<double, 4> &left,
 
 #  endif
 
-#  if DEAL_II_COMPILER_VECTORIZATION_LEVEL >= 1 && defined(__SSE2__)
+#  if DEAL_II_VECTORIZATION_WIDTH_IN_BITS >= 128 && defined(__SSE2__)
 
 template <SIMDComparison predicate>
 DEAL_II_ALWAYS_INLINE inline VectorizedArray<float, 4>
index 086c35440bef55d8c3343b9eb47a1010ab3bbdab..6dff37196ec642f5941b9bdd7a7c0371e39a5ca9 100644 (file)
@@ -1827,7 +1827,7 @@ namespace internal
                             const unsigned int *                 indices,
                             Number *                             dst_ptr)
   {
-#if DEAL_II_COMPILER_VECTORIZATION_LEVEL < 3
+#if DEAL_II_VECTORIZATION_WIDTH_IN_BITS < 512
     for (unsigned int v = 0; v < width; ++v)
       dst_ptr[indices[v]] += src[v];
 #else
index 46bd9b268c16886fe4559fd08747b0dc73eefc99..4addc2e23ee5d60c3b70009c52f250fd0403a9df 100644 (file)
@@ -460,7 +460,7 @@ namespace internal
                        VectorizedArrayType &res,
                        std::integral_constant<bool, true>) const
     {
-#if DEAL_II_COMPILER_VECTORIZATION_LEVEL < 3
+#if DEAL_II_VECTORIZATION_WIDTH_IN_BITS < 512
       for (unsigned int v = 0; v < VectorizedArrayType::size(); ++v)
         vector_access(vec, indices[v] + constant_offset) += res[v];
 #else
index 7f918ad5e4e1ca8b7b5f6d0dad7d148d522d48d2..d05aba28ce403fabd81da66c5b2aa9d3eccd6006 100644 (file)
@@ -899,24 +899,24 @@ namespace Utilities
     const std::string
     get_current_vectorization_level()
     {
-      switch (DEAL_II_COMPILER_VECTORIZATION_LEVEL)
+      switch (DEAL_II_VECTORIZATION_WIDTH_IN_BITS)
         {
           case 0:
             return "disabled";
-          case 1:
+          case 128:
 #ifdef __ALTIVEC__
             return "AltiVec";
 #else
             return "SSE2";
 #endif
-          case 2:
+          case 256:
             return "AVX";
-          case 3:
+          case 512:
             return "AVX512";
           default:
             AssertThrow(false,
                         ExcInternalError(
-                          "Invalid DEAL_II_COMPILER_VECTORIZATION_LEVEL."));
+                          "Invalid DEAL_II_VECTORIZATION_WIDTH_IN_BITS."));
             return "ERROR";
         }
     }
index f05ecb7b3a3dd37204b26f567da258ada4d8c9fd..b5a0633c446f8622ebba6b0dc5ad7d9dcf9c4877 100644 (file)
@@ -30,31 +30,25 @@ static_assert(std::is_standard_layout<VectorizedArray<float>>::value &&
                 std::is_trivial<VectorizedArray<float>>::value,
               "VectorizedArray<float> must be a POD type");
 
-#if DEAL_II_COMPILER_VECTORIZATION_LEVEL >= 1 && !defined(DEAL_II_MSVC)
-#  if DEAL_II_COMPILER_VECTORIZATION_LEVEL >= 3 && defined(__AVX512F__)
+// For the specializations of VectorizedArray, we need to instantiate the
+// static constexpr variable for some compilers. On the other hand, MSCV wants
+// us explicitly to not do so, otherwise we get: "error C2908: explicit
+// specialization 'const unsigned int
+// dealii::VectorizedArray<double, 2>::n_array_elements' has already been
+// instantiated".
+#if DEAL_II_VECTORIZATION_WIDTH_IN_BITS >= 128 && !defined(DEAL_II_MSVC)
+#  if DEAL_II_VECTORIZATION_WIDTH_IN_BITS >= 512
 const unsigned int VectorizedArray<double, 8>::n_array_elements;
-#  endif
-
-#  if DEAL_II_COMPILER_VECTORIZATION_LEVEL >= 2 && defined(__AVX__)
-const unsigned int VectorizedArray<double, 4>::n_array_elements;
-#  endif
-
-#  if (DEAL_II_COMPILER_VECTORIZATION_LEVEL >= 1 && defined(__SSE2__)) || \
-    (DEAL_II_COMPILER_VECTORIZATION_LEVEL >= 1 && defined(__ALTIVEC__))
-const unsigned int VectorizedArray<double, 2>::n_array_elements;
-#  endif
-
-
-#  if DEAL_II_COMPILER_VECTORIZATION_LEVEL >= 3 && defined(__AVX512F__)
 const unsigned int VectorizedArray<float, 16>::n_array_elements;
 #  endif
 
-#  if DEAL_II_COMPILER_VECTORIZATION_LEVEL >= 2 && defined(__AVX__)
+#  if DEAL_II_VECTORIZATION_WIDTH_IN_BITS >= 256
+const unsigned int VectorizedArray<double, 4>::n_array_elements;
 const unsigned int VectorizedArray<float, 8>::n_array_elements;
 #  endif
 
-#  if (DEAL_II_COMPILER_VECTORIZATION_LEVEL >= 1 && defined(__SSE2__)) || \
-    (DEAL_II_COMPILER_VECTORIZATION_LEVEL >= 1 && defined(__ALTIVEC__))
+#  if DEAL_II_VECTORIZATION_WIDTH_IN_BITS >= 128
+const unsigned int VectorizedArray<double, 2>::n_array_elements;
 const unsigned int VectorizedArray<float, 4>::n_array_elements;
 #  endif
 #endif
index 0e73c2e10e04fc767b495bb4e62c15b77c2dad60..83d8b197e9664c6edea4b9fd7f1132c7a4fed848 100644 (file)
@@ -36,22 +36,22 @@ template struct internal::MatrixFreeFunctions::
 template struct internal::MatrixFreeFunctions::
   FPArrayComparator<float, VectorizedArray<float, 1>>;
 
-#  if (DEAL_II_COMPILER_VECTORIZATION_LEVEL >= 1 && defined(__SSE2__)) || \
-    (DEAL_II_COMPILER_VECTORIZATION_LEVEL >= 1 && defined(__ALTIVEC__))
+#  if (DEAL_II_VECTORIZATION_WIDTH_IN_BITS >= 128 && defined(__SSE2__)) || \
+    (DEAL_II_VECTORIZATION_WIDTH_IN_BITS >= 128 && defined(__ALTIVEC__))
 template struct internal::MatrixFreeFunctions::
   FPArrayComparator<double, VectorizedArray<double, 2>>;
 template struct internal::MatrixFreeFunctions::
   FPArrayComparator<float, VectorizedArray<float, 4>>;
 #  endif
 
-#  if DEAL_II_COMPILER_VECTORIZATION_LEVEL >= 2 && defined(__AVX__)
+#  if DEAL_II_VECTORIZATION_WIDTH_IN_BITS >= 256 && defined(__AVX__)
 template struct internal::MatrixFreeFunctions::
   FPArrayComparator<double, VectorizedArray<double, 4>>;
 template struct internal::MatrixFreeFunctions::
   FPArrayComparator<float, VectorizedArray<float, 8>>;
 #  endif
 
-#  if DEAL_II_COMPILER_VECTORIZATION_LEVEL >= 3 && defined(__AVX512F__)
+#  if DEAL_II_VECTORIZATION_WIDTH_IN_BITS >= 512 && defined(__AVX512F__)
 template struct internal::MatrixFreeFunctions::
   FPArrayComparator<double, VectorizedArray<double, 8>>;
 template struct internal::MatrixFreeFunctions::
index 280b48d3e86913f627224e3ed6b0559735d12281..411ff6267c64d4f7c0ea11cffa37b5b7522fb88d 100644 (file)
@@ -47,17 +47,17 @@ main()
 {
   initlog();
 
-#if DEAL_II_COMPILER_VECTORIZATION_LEVEL >= 3 && defined(__AVX512F__)
+#if DEAL_II_VECTORIZATION_WIDTH_IN_BITS >= 512
   do_test(VectorizedArray<double, 8>(2.0));
   do_test(VectorizedArray<float, 16>(2.0));
 #endif
 
-#if DEAL_II_COMPILER_VECTORIZATION_LEVEL >= 2 && defined(__AVX__)
+#if DEAL_II_VECTORIZATION_WIDTH_IN_BITS >= 256
   do_test(VectorizedArray<double, 4>(2.0));
   do_test(VectorizedArray<float, 8>(2.0));
 #endif
 
-#if DEAL_II_COMPILER_VECTORIZATION_LEVEL >= 1 && defined(__SSE2__)
+#if DEAL_II_VECTORIZATION_WIDTH_IN_BITS >= 128
   do_test(VectorizedArray<double, 2>(2.0));
   do_test(VectorizedArray<float, 4>(2.0));
 #endif
index ad1beea6f30a7b53d5693f2b723d55b1b8189896..cebcdf6b7a57b76254bd569f17c3552cc044097e 100644 (file)
@@ -117,15 +117,15 @@ struct Tester<double, n_numbers>
   static void
   test()
   {
-#if DEAL_II_COMPILER_VECTORIZATION_LEVEL >= 3 && defined(__AVX512F__)
+#if DEAL_II_VECTORIZATION_WIDTH_IN_BITS >= 512
     do_test<double, n_numbers, 8>();
 #endif
 
-#if DEAL_II_COMPILER_VECTORIZATION_LEVEL >= 2 && defined(__AVX__)
+#if DEAL_II_VECTORIZATION_WIDTH_IN_BITS >= 256
     do_test<double, n_numbers, 4>();
 #endif
 
-#if DEAL_II_COMPILER_VECTORIZATION_LEVEL >= 1 && defined(__SSE2__)
+#if DEAL_II_VECTORIZATION_WIDTH_IN_BITS >= 128
     do_test<double, n_numbers, 2>();
 #endif
 
@@ -139,15 +139,15 @@ struct Tester<float, n_numbers>
   static void
   test()
   {
-#if DEAL_II_COMPILER_VECTORIZATION_LEVEL >= 3 && defined(__AVX512F__)
+#if DEAL_II_VECTORIZATION_WIDTH_IN_BITS >= 512
     do_test<float, n_numbers, 16>();
 #endif
 
-#if DEAL_II_COMPILER_VECTORIZATION_LEVEL >= 2 && defined(__AVX__)
+#if DEAL_II_VECTORIZATION_WIDTH_IN_BITS >= 256
     do_test<float, n_numbers, 8>();
 #endif
 
-#if DEAL_II_COMPILER_VECTORIZATION_LEVEL >= 1 && defined(__SSE2__)
+#if DEAL_II_VECTORIZATION_WIDTH_IN_BITS >= 128
     do_test<float, n_numbers, 4>();
 #endif
 
index 3a26982d36ebdb8c040e4400b2edeabffbbb4050..9912641b887f0e54bfb55be4cbff2c41397000e1 100644 (file)
@@ -54,17 +54,17 @@ struct Tester<double>
     do_test(make_vectorized_array<double>(2.0), 2.0);
     do_test(VectorizedArray<double>(2.0), 2.0);
 
-#if DEAL_II_COMPILER_VECTORIZATION_LEVEL >= 3 && defined(__AVX512F__)
+#if DEAL_II_VECTORIZATION_WIDTH_IN_BITS >= 512
     do_test(make_vectorized_array<VectorizedArray<double, 8>>(2.0), 2.0);
     do_test(VectorizedArray<double, 8>(2.0), 2.0);
 #endif
 
-#if DEAL_II_COMPILER_VECTORIZATION_LEVEL >= 2 && defined(__AVX__)
+#if DEAL_II_VECTORIZATION_WIDTH_IN_BITS >= 256
     do_test(make_vectorized_array<VectorizedArray<double, 4>>(2.0), 2.0);
     do_test(VectorizedArray<double, 4>(2.0), 2.0);
 #endif
 
-#if DEAL_II_COMPILER_VECTORIZATION_LEVEL >= 1 && defined(__SSE2__)
+#if DEAL_II_VECTORIZATION_WIDTH_IN_BITS >= 128
     do_test(make_vectorized_array<VectorizedArray<double, 2>>(2.0), 2.0);
     do_test(VectorizedArray<double, 2>(2.0), 2.0);
 #endif
@@ -83,17 +83,17 @@ struct Tester<float>
     do_test(make_vectorized_array<float>(2.0), 2.0);
     do_test(VectorizedArray<float>(2.0), 2.0);
 
-#if DEAL_II_COMPILER_VECTORIZATION_LEVEL >= 3 && defined(__AVX512F__)
+#if DEAL_II_VECTORIZATION_WIDTH_IN_BITS >= 512
     do_test(make_vectorized_array<VectorizedArray<float, 16>>(2.0), 2.0);
     do_test(VectorizedArray<float, 16>(2.0), 2.0);
 #endif
 
-#if DEAL_II_COMPILER_VECTORIZATION_LEVEL >= 2 && defined(__AVX__)
+#if DEAL_II_VECTORIZATION_WIDTH_IN_BITS >= 256
     do_test(make_vectorized_array<VectorizedArray<float, 8>>(2.0), 2.0);
     do_test(VectorizedArray<float, 8>(2.0), 2.0);
 #endif
 
-#if DEAL_II_COMPILER_VECTORIZATION_LEVEL >= 1 && defined(__SSE2__)
+#if DEAL_II_VECTORIZATION_WIDTH_IN_BITS >= 128
     do_test(make_vectorized_array<VectorizedArray<float, 4>>(2.0), 2.0);
     do_test(VectorizedArray<float, 4>(2.0), 2.0);
 #endif
index 59ffcfe743c1b0ba30d3004687d3b28f646a7ab1..724c6c4d9a36e727235812e61b51e831a34f7d96 100644 (file)
@@ -42,17 +42,17 @@ main()
 {
   initlog();
 
-#if DEAL_II_COMPILER_VECTORIZATION_LEVEL >= 3 && defined(__AVX512F__)
+#if DEAL_II_VECTORIZATION_WIDTH_IN_BITS >= 512
   do_test(VectorizedArray<double, 8>(2.0), 3.0);
   do_test(VectorizedArray<float, 16>(2.0), 3.0);
 #endif
 
-#if DEAL_II_COMPILER_VECTORIZATION_LEVEL >= 2 && defined(__AVX__)
+#if DEAL_II_VECTORIZATION_WIDTH_IN_BITS >= 256
   do_test(VectorizedArray<double, 4>(2.0), 3.0);
   do_test(VectorizedArray<float, 8>(2.0), 3.0);
 #endif
 
-#if DEAL_II_COMPILER_VECTORIZATION_LEVEL >= 1 && defined(__SSE2__)
+#if DEAL_II_VECTORIZATION_WIDTH_IN_BITS >= 128
   do_test(VectorizedArray<double, 2>(2.0), 3.0);
   do_test(VectorizedArray<float, 4>(2.0), 3.0);
 #endif
index 3ff642e466411458491d3ab4a72eafe83b3d403d..949f523ab80a074574fb0a490f3f1060052cbc4a 100644 (file)
@@ -75,17 +75,17 @@ main()
 {
   initlog();
 
-#if DEAL_II_COMPILER_VECTORIZATION_LEVEL >= 3 && defined(__AVX512F__)
+#if DEAL_II_VECTORIZATION_WIDTH_IN_BITS >= 512
   do_test<VectorizedArray<double, 8>>();
   do_test<VectorizedArray<float, 16>>();
 #endif
 
-#if DEAL_II_COMPILER_VECTORIZATION_LEVEL >= 2 && defined(__AVX__)
+#if DEAL_II_VECTORIZATION_WIDTH_IN_BITS >= 256
   do_test<VectorizedArray<double, 4>>();
   do_test<VectorizedArray<float, 8>>();
 #endif
 
-#if DEAL_II_COMPILER_VECTORIZATION_LEVEL >= 1 && defined(__SSE2__)
+#if DEAL_II_VECTORIZATION_WIDTH_IN_BITS >= 128
   do_test<VectorizedArray<double, 2>>();
   do_test<VectorizedArray<float, 4>>();
 #endif
index 41da2ff1a051a47fb0252c3ad44ecc4fb48c95f8..d19ff95b00e3419af9f492b183f44a0bed8376c3 100644 (file)
@@ -129,15 +129,15 @@ struct Tester<double, n_numbers>
   static void
   test()
   {
-#if DEAL_II_COMPILER_VECTORIZATION_LEVEL >= 3 && defined(__AVX512F__)
+#if DEAL_II_VECTORIZATION_WIDTH_IN_BITS >= 512
     do_test<double, n_numbers, 8>();
 #endif
 
-#if DEAL_II_COMPILER_VECTORIZATION_LEVEL >= 2 && defined(__AVX__)
+#if DEAL_II_VECTORIZATION_WIDTH_IN_BITS >= 256
     do_test<double, n_numbers, 4>();
 #endif
 
-#if DEAL_II_COMPILER_VECTORIZATION_LEVEL >= 1 && defined(__SSE2__)
+#if DEAL_II_VECTORIZATION_WIDTH_IN_BITS >= 128
     do_test<double, n_numbers, 2>();
 #endif
 
@@ -151,15 +151,15 @@ struct Tester<float, n_numbers>
   static void
   test()
   {
-#if DEAL_II_COMPILER_VECTORIZATION_LEVEL >= 3 && defined(__AVX512F__)
+#if DEAL_II_VECTORIZATION_WIDTH_IN_BITS >= 512
     do_test<float, n_numbers, 16>();
 #endif
 
-#if DEAL_II_COMPILER_VECTORIZATION_LEVEL >= 2 && defined(__AVX__)
+#if DEAL_II_VECTORIZATION_WIDTH_IN_BITS >= 256
     do_test<float, n_numbers, 8>();
 #endif
 
-#if DEAL_II_COMPILER_VECTORIZATION_LEVEL >= 1 && defined(__SSE2__)
+#if DEAL_II_VECTORIZATION_WIDTH_IN_BITS >= 128
     do_test<float, n_numbers, 4>();
 #endif
 
index 0fdfb205574b9af6495c473df8af79156ee70807..06020ffab70db94e3ca70e7f3d4c11ac113dcf96 100644 (file)
@@ -44,18 +44,17 @@ test()
   do_test<dim, fe_degree, fe_degree + 1, double, VectorizedArray<double, 1>>(
     dof, constraints, true);
 
-#if (DEAL_II_COMPILER_VECTORIZATION_LEVEL >= 1 && defined(__SSE2__)) || \
-  (DEAL_II_COMPILER_VECTORIZATION_LEVEL >= 1 && defined(__ALTIVEC__))
+#if DEAL_II_VECTORIZATION_WIDTH_IN_BITS >= 128
   do_test<dim, fe_degree, fe_degree + 1, double, VectorizedArray<double, 2>>(
     dof, constraints, true);
 #endif
 
-#if DEAL_II_COMPILER_VECTORIZATION_LEVEL >= 2 && defined(__AVX__)
+#if DEAL_II_VECTORIZATION_WIDTH_IN_BITS >= 256
   do_test<dim, fe_degree, fe_degree + 1, double, VectorizedArray<double, 4>>(
     dof, constraints, true);
 #endif
 
-#if DEAL_II_COMPILER_VECTORIZATION_LEVEL >= 3 && defined(__AVX512F__)
+#if DEAL_II_VECTORIZATION_WIDTH_IN_BITS >= 512
   do_test<dim, fe_degree, fe_degree + 1, double, VectorizedArray<double, 8>>(
     dof, constraints, true);
 #endif

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.