]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Automated template instantiation for VectorizedArray 8383/head
authorpeterrum <peterrmuench@gmail.com>
Tue, 9 Jul 2019 04:54:01 +0000 (06:54 +0200)
committerpeterrum <peterrmuench@gmail.com>
Sun, 14 Jul 2019 15:49:17 +0000 (17:49 +0200)
cmake/config/template-arguments.in
cmake/configure/configure_vectorization.cmake [new file with mode: 0644]
doc/news/changes/minor/20190713PeterMunch [new file with mode: 0644]
source/matrix_free/mapping_info.inst.in
source/matrix_free/matrix_free.inst.in

index 3370a92a6cbdbc8cf466810728bf86cf02ccf82a..c968be136efbad95c9be4fc8453ad35c6982951d 100644 (file)
@@ -8,6 +8,10 @@ BOOL            := { true; false }
 // real scalar floating point types
 REAL_SCALARS    := { double; float }
 
+// real scalar floating point types (vectorized)
+REAL_SCALARS_VECTORIZED    := { @DEAL_II_EXPAND_REAL_SCALARS_VECTORIZED@; }
+FLOAT_VECTORIZED           := { @DEAL_II_EXPAND_FLOAT_VECTORIZED@; }
+
 // complex scalar types
 COMPLEX_SCALARS := { 
     @DEAL_II_EXPAND_COMPLEX_SCALARS@;
diff --git a/cmake/configure/configure_vectorization.cmake b/cmake/configure/configure_vectorization.cmake
new file mode 100644 (file)
index 0000000..aa17a02
--- /dev/null
@@ -0,0 +1,40 @@
+## ---------------------------------------------------------------------
+##
+## Copyright (C) 2019 by the deal.II authors
+##
+## This file is part of the deal.II library.
+##
+## The deal.II library is free software; you can use it, redistribute
+## it, and/or modify it under the terms of the GNU Lesser General
+## Public License as published by the Free Software Foundation; either
+## version 2.1 of the License, or (at your option) any later version.
+## The full text of the license can be found in the file LICENSE.md at
+## the top level directory of deal.II.
+##
+## ---------------------------------------------------------------------
+#
+# Configuration for real scalar vectorization
+#
+
+
+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)
+   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))
+   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)
+   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>")
+ENDIF()
diff --git a/doc/news/changes/minor/20190713PeterMunch b/doc/news/changes/minor/20190713PeterMunch
new file mode 100644 (file)
index 0000000..661ec87
--- /dev/null
@@ -0,0 +1,4 @@
+New: Provide a list of all possible VectorizedArray<Number, width> instances for a given
+hardware and optimization level. The list can be used during template instantiation.
+<br>
+(Peter Munch, 2019/07/13)
index 2adf59c3f610f4159740e73094839842f4c0af51..fe47a54bb71e4a84318d62a2fc6c817041e14f65 100644 (file)
 // ---------------------------------------------------------------------
 
 
-for (deal_II_dimension : DIMENSIONS)
+for (deal_II_dimension : DIMENSIONS;
+     deal_II_scalar_vectorized : REAL_SCALARS_VECTORIZED)
   {
-    template struct internal::MatrixFreeFunctions::
-      MappingInfo<deal_II_dimension, double, VectorizedArray<double, 1>>;
-    template struct internal::MatrixFreeFunctions::
-      MappingInfo<deal_II_dimension, float, VectorizedArray<float, 1>>;
-
-    template struct internal::MatrixFreeFunctions::MappingInfoStorage<
-      deal_II_dimension,
-      deal_II_dimension,
-      double,
-      VectorizedArray<double, 1>>;
-    template struct internal::MatrixFreeFunctions::MappingInfoStorage<
-      deal_II_dimension,
-      deal_II_dimension,
-      float,
-      VectorizedArray<float, 1>>;
-#if deal_II_dimension > 1
-    template struct internal::MatrixFreeFunctions::MappingInfoStorage<
-      deal_II_dimension - 1,
-      deal_II_dimension,
-      double,
-      VectorizedArray<double, 1>>;
-    template struct internal::MatrixFreeFunctions::MappingInfoStorage<
-      deal_II_dimension - 1,
+    template struct internal::MatrixFreeFunctions::MappingInfo<
       deal_II_dimension,
-      float,
-      VectorizedArray<float, 1>>;
-#endif
-
-    template void internal::MatrixFreeFunctions::
-      MappingInfo<deal_II_dimension, double, VectorizedArray<double, 1>>::
-        print_memory_consumption<std::ostream>(std::ostream &, const TaskInfo &)
-          const;
-    template void internal::MatrixFreeFunctions::
-      MappingInfo<deal_II_dimension, double, VectorizedArray<double, 1>>::
-        print_memory_consumption<ConditionalOStream>(ConditionalOStream &,
-                                                     const TaskInfo &) const;
-
-    template void internal::MatrixFreeFunctions::
-      MappingInfo<deal_II_dimension, float, VectorizedArray<float, 1>>::
-        print_memory_consumption<std::ostream>(std::ostream &, const TaskInfo &)
-          const;
-    template void internal::MatrixFreeFunctions::
-      MappingInfo<deal_II_dimension, float, VectorizedArray<float, 1>>::
-        print_memory_consumption<ConditionalOStream>(ConditionalOStream &,
-                                                     const TaskInfo &) const;
+      deal_II_scalar_vectorized::value_type,
+      deal_II_scalar_vectorized>;
 
-
-
-#if (DEAL_II_COMPILER_VECTORIZATION_LEVEL >= 1 && defined(__SSE2__)) || \
-  (DEAL_II_COMPILER_VECTORIZATION_LEVEL >= 1 && defined(__ALTIVEC__))
-    template struct internal::MatrixFreeFunctions::
-      MappingInfo<deal_II_dimension, double, VectorizedArray<double, 2>>;
-    template struct internal::MatrixFreeFunctions::
-      MappingInfo<deal_II_dimension, float, VectorizedArray<float, 4>>;
-
-    template struct internal::MatrixFreeFunctions::MappingInfoStorage<
-      deal_II_dimension,
-      deal_II_dimension,
-      double,
-      VectorizedArray<double, 2>>;
     template struct internal::MatrixFreeFunctions::MappingInfoStorage<
       deal_II_dimension,
       deal_II_dimension,
-      float,
-      VectorizedArray<float, 4>>;
-#  if deal_II_dimension > 1
-    template struct internal::MatrixFreeFunctions::MappingInfoStorage<
-      deal_II_dimension - 1,
-      deal_II_dimension,
-      double,
-      VectorizedArray<double, 2>>;
-    template struct internal::MatrixFreeFunctions::MappingInfoStorage<
-      deal_II_dimension - 1,
-      deal_II_dimension,
-      float,
-      VectorizedArray<float, 4>>;
-#  endif
-
-    template void internal::MatrixFreeFunctions::
-      MappingInfo<deal_II_dimension, double, VectorizedArray<double, 2>>::
-        print_memory_consumption<std::ostream>(std::ostream &, const TaskInfo &)
-          const;
-    template void internal::MatrixFreeFunctions::
-      MappingInfo<deal_II_dimension, double, VectorizedArray<double, 2>>::
-        print_memory_consumption<ConditionalOStream>(ConditionalOStream &,
-                                                     const TaskInfo &) const;
-
-    template void internal::MatrixFreeFunctions::
-      MappingInfo<deal_II_dimension, float, VectorizedArray<float, 4>>::
-        print_memory_consumption<std::ostream>(std::ostream &, const TaskInfo &)
-          const;
-    template void internal::MatrixFreeFunctions::
-      MappingInfo<deal_II_dimension, float, VectorizedArray<float, 4>>::
-        print_memory_consumption<ConditionalOStream>(ConditionalOStream &,
-                                                     const TaskInfo &) const;
-#endif
+      deal_II_scalar_vectorized::value_type,
+      deal_II_scalar_vectorized>;
 
-
-
-#if DEAL_II_COMPILER_VECTORIZATION_LEVEL >= 2 && defined(__AVX__)
-    template struct internal::MatrixFreeFunctions::
-      MappingInfo<deal_II_dimension, double, VectorizedArray<double, 4>>;
-    template struct internal::MatrixFreeFunctions::
-      MappingInfo<deal_II_dimension, float, VectorizedArray<float, 8>>;
-
-    template struct internal::MatrixFreeFunctions::MappingInfoStorage<
-      deal_II_dimension,
-      deal_II_dimension,
-      double,
-      VectorizedArray<double, 4>>;
-    template struct internal::MatrixFreeFunctions::MappingInfoStorage<
-      deal_II_dimension,
-      deal_II_dimension,
-      float,
-      VectorizedArray<float, 8>>;
-#  if deal_II_dimension > 1
-    template struct internal::MatrixFreeFunctions::MappingInfoStorage<
-      deal_II_dimension - 1,
-      deal_II_dimension,
-      double,
-      VectorizedArray<double, 4>>;
+#if deal_II_dimension > 1
     template struct internal::MatrixFreeFunctions::MappingInfoStorage<
       deal_II_dimension - 1,
       deal_II_dimension,
-      float,
-      VectorizedArray<float, 8>>;
-#  endif
-
-    template void internal::MatrixFreeFunctions::
-      MappingInfo<deal_II_dimension, double, VectorizedArray<double, 4>>::
-        print_memory_consumption<std::ostream>(std::ostream &, const TaskInfo &)
-          const;
-    template void internal::MatrixFreeFunctions::
-      MappingInfo<deal_II_dimension, double, VectorizedArray<double, 4>>::
-        print_memory_consumption<ConditionalOStream>(ConditionalOStream &,
-                                                     const TaskInfo &) const;
-
-    template void internal::MatrixFreeFunctions::
-      MappingInfo<deal_II_dimension, float, VectorizedArray<float, 8>>::
-        print_memory_consumption<std::ostream>(std::ostream &, const TaskInfo &)
-          const;
-    template void internal::MatrixFreeFunctions::
-      MappingInfo<deal_II_dimension, float, VectorizedArray<float, 8>>::
-        print_memory_consumption<ConditionalOStream>(ConditionalOStream &,
-                                                     const TaskInfo &) const;
+      deal_II_scalar_vectorized::value_type,
+      deal_II_scalar_vectorized>;
 #endif
 
-
-
-#if DEAL_II_COMPILER_VECTORIZATION_LEVEL >= 3 && defined(__AVX512F__)
-    template struct internal::MatrixFreeFunctions::
-      MappingInfo<deal_II_dimension, double, VectorizedArray<double, 8>>;
-    template struct internal::MatrixFreeFunctions::
-      MappingInfo<deal_II_dimension, float, VectorizedArray<float, 16>>;
-
-    template struct internal::MatrixFreeFunctions::MappingInfoStorage<
-      deal_II_dimension,
-      deal_II_dimension,
-      double,
-      VectorizedArray<double, 8>>;
-    template struct internal::MatrixFreeFunctions::MappingInfoStorage<
+    template void internal::MatrixFreeFunctions::MappingInfo<
       deal_II_dimension,
+      deal_II_scalar_vectorized::value_type,
+      deal_II_scalar_vectorized>::
+      print_memory_consumption<std::ostream>(std::ostream &, const TaskInfo &)
+        const;
+    template void internal::MatrixFreeFunctions::MappingInfo<
       deal_II_dimension,
-      float,
-      VectorizedArray<float, 16>>;
-#  if deal_II_dimension > 1
-    template struct internal::MatrixFreeFunctions::MappingInfoStorage<
-      deal_II_dimension - 1,
-      deal_II_dimension,
-      double,
-      VectorizedArray<double, 8>>;
-    template struct internal::MatrixFreeFunctions::MappingInfoStorage<
-      deal_II_dimension - 1,
-      deal_II_dimension,
-      float,
-      VectorizedArray<float, 16>>;
-#  endif
-
-    template void internal::MatrixFreeFunctions::
-      MappingInfo<deal_II_dimension, double, VectorizedArray<double, 8>>::
-        print_memory_consumption<std::ostream>(std::ostream &, const TaskInfo &)
-          const;
-    template void internal::MatrixFreeFunctions::
-      MappingInfo<deal_II_dimension, double, VectorizedArray<double, 8>>::
-        print_memory_consumption<ConditionalOStream>(ConditionalOStream &,
-                                                     const TaskInfo &) const;
-
-    template void internal::MatrixFreeFunctions::
-      MappingInfo<deal_II_dimension, float, VectorizedArray<float, 16>>::
-        print_memory_consumption<std::ostream>(std::ostream &, const TaskInfo &)
-          const;
-    template void internal::MatrixFreeFunctions::
-      MappingInfo<deal_II_dimension, float, VectorizedArray<float, 16>>::
-        print_memory_consumption<ConditionalOStream>(ConditionalOStream &,
-                                                     const TaskInfo &) const;
-#endif
+      deal_II_scalar_vectorized::value_type,
+      deal_II_scalar_vectorized>::
+      print_memory_consumption<ConditionalOStream>(ConditionalOStream &,
+                                                   const TaskInfo &) const;
   }
index 73b00dcaefb61dc8a72c8a3bd97fe6f249bd8ef7..9fe8f0f8fbbe905bd1f6281d768cfc6cbfa2355f 100644 (file)
 // ---------------------------------------------------------------------
 
 
-for (deal_II_dimension : DIMENSIONS)
+for (deal_II_dimension : DIMENSIONS; deal_II_scalar : REAL_SCALARS)
   {
-    template void
-    internal::MatrixFreeFunctions::ShapeInfo<double>::reinit<deal_II_dimension>(
-      const Quadrature<1> &,
-      const FiniteElement<deal_II_dimension, deal_II_dimension> &,
-      const unsigned int);
-
-    template void
-    internal::MatrixFreeFunctions::ShapeInfo<float>::reinit<deal_II_dimension>(
-      const Quadrature<1> &,
-      const FiniteElement<deal_II_dimension, deal_II_dimension> &,
-      const unsigned int);
-  }
-
-
-
-for (deal_II_dimension : DIMENSIONS)
-  {
-    template class MatrixFree<deal_II_dimension,
-                              double,
-                              VectorizedArray<double, 1>>;
-    template class MatrixFree<deal_II_dimension,
-                              float,
-                              VectorizedArray<float, 1>>;
-
-    template void
-    MatrixFree<deal_II_dimension, double, VectorizedArray<double, 1>>::
-      print_memory_consumption<std::ostream>(std::ostream &) const;
-
-    template void
-    MatrixFree<deal_II_dimension, double, VectorizedArray<double, 1>>::
-      print_memory_consumption<ConditionalOStream>(ConditionalOStream &) const;
-
-    template void
-    MatrixFree<deal_II_dimension, float, VectorizedArray<float, 1>>::
-      print_memory_consumption<std::ostream>(std::ostream &) const;
-
-    template void
-    MatrixFree<deal_II_dimension, float, VectorizedArray<float, 1>>::
-      print_memory_consumption<ConditionalOStream>(ConditionalOStream &) const;
-
-    template void
-    MatrixFree<deal_II_dimension, double, VectorizedArray<double, 1>>::
-      internal_reinit<double>(
-        const Mapping<deal_II_dimension> &,
-        const std::vector<const DoFHandler<deal_II_dimension> *> &,
-        const std::vector<const AffineConstraints<double> *> &,
-        const std::vector<IndexSet> &,
-        const std::vector<hp::QCollection<1>> &,
-        const AdditionalData &);
-
-    template void
-    MatrixFree<deal_II_dimension, double, VectorizedArray<double, 1>>::
-      internal_reinit<double>(
-        const Mapping<deal_II_dimension> &,
-        const std::vector<const hp::DoFHandler<deal_II_dimension> *> &,
-        const std::vector<const AffineConstraints<double> *> &,
-        const std::vector<IndexSet> &,
-        const std::vector<hp::QCollection<1>> &,
-        const AdditionalData &);
-
-    template void
-    MatrixFree<deal_II_dimension, float, VectorizedArray<float, 1>>::
-      internal_reinit<double>(
-        const Mapping<deal_II_dimension> &,
-        const std::vector<const DoFHandler<deal_II_dimension> *> &,
-        const std::vector<const AffineConstraints<double> *> &,
-        const std::vector<IndexSet> &,
-        const std::vector<hp::QCollection<1>> &,
-        const AdditionalData &);
-
-    template void
-    MatrixFree<deal_II_dimension, float, VectorizedArray<float, 1>>::
-      internal_reinit<double>(
-        const Mapping<deal_II_dimension> &,
-        const std::vector<const hp::DoFHandler<deal_II_dimension> *> &,
-        const std::vector<const AffineConstraints<double> *> &,
-        const std::vector<IndexSet> &,
-        const std::vector<hp::QCollection<1>> &,
-        const AdditionalData &);
-
-    template void
-    MatrixFree<deal_II_dimension, float, VectorizedArray<float, 1>>::
-      internal_reinit<float>(
-        const Mapping<deal_II_dimension> &,
-        const std::vector<const DoFHandler<deal_II_dimension> *> &,
-        const std::vector<const AffineConstraints<float> *> &,
-        const std::vector<IndexSet> &,
-        const std::vector<hp::QCollection<1>> &,
-        const AdditionalData &);
-
-    template void
-    MatrixFree<deal_II_dimension, float, VectorizedArray<float, 1>>::
-      internal_reinit<float>(
-        const Mapping<deal_II_dimension> &,
-        const std::vector<const hp::DoFHandler<deal_II_dimension> *> &,
-        const std::vector<const AffineConstraints<float> *> &,
-        const std::vector<IndexSet> &,
-        const std::vector<hp::QCollection<1>> &,
-        const AdditionalData &);
-
-    template void internal::MatrixFreeFunctions::
-      ShapeInfo<VectorizedArray<double, 1>>::reinit<deal_II_dimension>(
-        const Quadrature<1> &,
-        const FiniteElement<deal_II_dimension, deal_II_dimension> &,
-        const unsigned int);
-
-    template void internal::MatrixFreeFunctions::
-      ShapeInfo<VectorizedArray<float, 1>>::reinit<deal_II_dimension>(
-        const Quadrature<1> &,
-        const FiniteElement<deal_II_dimension, deal_II_dimension> &,
-        const unsigned int);
-  }
-
-
-
-for (deal_II_dimension : DIMENSIONS; deal_II_space_dimension : SPACE_DIMENSIONS)
-  {
-#if deal_II_dimension <= deal_II_space_dimension
-    template bool
-    MatrixFree<deal_II_dimension, double, VectorizedArray<double, 1>>::
-      is_supported(
-        const FiniteElement<deal_II_dimension, deal_II_space_dimension> &);
-
-    template bool
-    MatrixFree<deal_II_dimension, float, VectorizedArray<float, 1>>::
-      is_supported(
-        const FiniteElement<deal_II_dimension, deal_II_space_dimension> &);
-#endif
-  }
-
-
-
-for (deal_II_dimension : DIMENSIONS)
-  {
-#if DEAL_II_COMPILER_VECTORIZATION_LEVEL >= 2 && defined(__AVX__)
-    template class MatrixFree<deal_II_dimension,
-                              double,
-                              VectorizedArray<double, 4>>;
-    template class MatrixFree<deal_II_dimension,
-                              float,
-                              VectorizedArray<float, 8>>;
-
-    template void
-    MatrixFree<deal_II_dimension, double, VectorizedArray<double, 4>>::
-      print_memory_consumption<std::ostream>(std::ostream &) const;
-
-    template void
-    MatrixFree<deal_II_dimension, double, VectorizedArray<double, 4>>::
-      print_memory_consumption<ConditionalOStream>(ConditionalOStream &) const;
-
-    template void
-    MatrixFree<deal_II_dimension, float, VectorizedArray<float, 8>>::
-      print_memory_consumption<std::ostream>(std::ostream &) const;
-
-    template void
-    MatrixFree<deal_II_dimension, float, VectorizedArray<float, 8>>::
-      print_memory_consumption<ConditionalOStream>(ConditionalOStream &) const;
-
-    template void
-    MatrixFree<deal_II_dimension, double, VectorizedArray<double, 4>>::
-      internal_reinit<double>(
-        const Mapping<deal_II_dimension> &,
-        const std::vector<const DoFHandler<deal_II_dimension> *> &,
-        const std::vector<const AffineConstraints<double> *> &,
-        const std::vector<IndexSet> &,
-        const std::vector<hp::QCollection<1>> &,
-        const AdditionalData &);
-
-    template void
-    MatrixFree<deal_II_dimension, double, VectorizedArray<double, 4>>::
-      internal_reinit<double>(
-        const Mapping<deal_II_dimension> &,
-        const std::vector<const hp::DoFHandler<deal_II_dimension> *> &,
-        const std::vector<const AffineConstraints<double> *> &,
-        const std::vector<IndexSet> &,
-        const std::vector<hp::QCollection<1>> &,
-        const AdditionalData &);
-
-    template void
-    MatrixFree<deal_II_dimension, float, VectorizedArray<float, 8>>::
-      internal_reinit<double>(
-        const Mapping<deal_II_dimension> &,
-        const std::vector<const DoFHandler<deal_II_dimension> *> &,
-        const std::vector<const AffineConstraints<double> *> &,
-        const std::vector<IndexSet> &,
-        const std::vector<hp::QCollection<1>> &,
-        const AdditionalData &);
-
-    template void
-    MatrixFree<deal_II_dimension, float, VectorizedArray<float, 8>>::
-      internal_reinit<double>(
-        const Mapping<deal_II_dimension> &,
-        const std::vector<const hp::DoFHandler<deal_II_dimension> *> &,
-        const std::vector<const AffineConstraints<double> *> &,
-        const std::vector<IndexSet> &,
-        const std::vector<hp::QCollection<1>> &,
-        const AdditionalData &);
-
-    template void
-    MatrixFree<deal_II_dimension, float, VectorizedArray<float, 8>>::
-      internal_reinit<float>(
-        const Mapping<deal_II_dimension> &,
-        const std::vector<const DoFHandler<deal_II_dimension> *> &,
-        const std::vector<const AffineConstraints<float> *> &,
-        const std::vector<IndexSet> &,
-        const std::vector<hp::QCollection<1>> &,
-        const AdditionalData &);
-
-    template void
-    MatrixFree<deal_II_dimension, float, VectorizedArray<float, 8>>::
-      internal_reinit<float>(
-        const Mapping<deal_II_dimension> &,
-        const std::vector<const hp::DoFHandler<deal_II_dimension> *> &,
-        const std::vector<const AffineConstraints<float> *> &,
-        const std::vector<IndexSet> &,
-        const std::vector<hp::QCollection<1>> &,
-        const AdditionalData &);
-
-    template void internal::MatrixFreeFunctions::
-      ShapeInfo<VectorizedArray<double, 4>>::reinit<deal_II_dimension>(
+    template void internal::MatrixFreeFunctions::ShapeInfo<deal_II_scalar>::
+      reinit<deal_II_dimension>(
         const Quadrature<1> &,
         const FiniteElement<deal_II_dimension, deal_II_dimension> &,
         const unsigned int);
-
-    template void internal::MatrixFreeFunctions::
-      ShapeInfo<VectorizedArray<float, 8>>::reinit<deal_II_dimension>(
-        const Quadrature<1> &,
-        const FiniteElement<deal_II_dimension, deal_II_dimension> &,
-        const unsigned int);
-#endif
-  }
-
-
-
-for (deal_II_dimension : DIMENSIONS; deal_II_space_dimension : SPACE_DIMENSIONS)
-  {
-#if DEAL_II_COMPILER_VECTORIZATION_LEVEL >= 2 && defined(__AVX__)
-#  if deal_II_dimension <= deal_II_space_dimension
-    template bool
-    MatrixFree<deal_II_dimension, double, VectorizedArray<double, 4>>::
-      is_supported(
-        const FiniteElement<deal_II_dimension, deal_II_space_dimension> &);
-
-    template bool
-    MatrixFree<deal_II_dimension, float, VectorizedArray<float, 8>>::
-      is_supported(
-        const FiniteElement<deal_II_dimension, deal_II_space_dimension> &);
-#  endif
-#endif
   }
 
 
 
-for (deal_II_dimension : DIMENSIONS)
+for (deal_II_dimension : DIMENSIONS;
+     deal_II_scalar_vectorized : REAL_SCALARS_VECTORIZED)
   {
-#if (DEAL_II_COMPILER_VECTORIZATION_LEVEL >= 1 && defined(__SSE2__)) || \
-  (DEAL_II_COMPILER_VECTORIZATION_LEVEL >= 1 && defined(__ALTIVEC__))
-    template class MatrixFree<deal_II_dimension,
-                              double,
-                              VectorizedArray<double, 2>>;
     template class MatrixFree<deal_II_dimension,
-                              float,
-                              VectorizedArray<float, 4>>;
+                              deal_II_scalar_vectorized::value_type,
+                              deal_II_scalar_vectorized>;
 
-    template void
-    MatrixFree<deal_II_dimension, double, VectorizedArray<double, 2>>::
+    template void MatrixFree<deal_II_dimension,
+                             deal_II_scalar_vectorized::value_type,
+                             deal_II_scalar_vectorized>::
       print_memory_consumption<std::ostream>(std::ostream &) const;
 
-    template void
-    MatrixFree<deal_II_dimension, double, VectorizedArray<double, 2>>::
+    template void MatrixFree<deal_II_dimension,
+                             deal_II_scalar_vectorized::value_type,
+                             deal_II_scalar_vectorized>::
       print_memory_consumption<ConditionalOStream>(ConditionalOStream &) const;
 
-    template void
-    MatrixFree<deal_II_dimension, float, VectorizedArray<float, 4>>::
-      print_memory_consumption<std::ostream>(std::ostream &) const;
-
-    template void
-    MatrixFree<deal_II_dimension, float, VectorizedArray<float, 4>>::
-      print_memory_consumption<ConditionalOStream>(ConditionalOStream &) const;
-
-    template void
-    MatrixFree<deal_II_dimension, double, VectorizedArray<double, 2>>::
-      internal_reinit<double>(
-        const Mapping<deal_II_dimension> &,
-        const std::vector<const DoFHandler<deal_II_dimension> *> &,
-        const std::vector<const AffineConstraints<double> *> &,
-        const std::vector<IndexSet> &,
-        const std::vector<hp::QCollection<1>> &,
-        const AdditionalData &);
-
-    template void
-    MatrixFree<deal_II_dimension, double, VectorizedArray<double, 2>>::
-      internal_reinit<double>(
-        const Mapping<deal_II_dimension> &,
-        const std::vector<const hp::DoFHandler<deal_II_dimension> *> &,
-        const std::vector<const AffineConstraints<double> *> &,
-        const std::vector<IndexSet> &,
-        const std::vector<hp::QCollection<1>> &,
-        const AdditionalData &);
-
-    template void
-    MatrixFree<deal_II_dimension, float, VectorizedArray<float, 4>>::
-      internal_reinit<double>(
-        const Mapping<deal_II_dimension> &,
-        const std::vector<const DoFHandler<deal_II_dimension> *> &,
-        const std::vector<const AffineConstraints<double> *> &,
-        const std::vector<IndexSet> &,
-        const std::vector<hp::QCollection<1>> &,
-        const AdditionalData &);
-
-    template void
-    MatrixFree<deal_II_dimension, float, VectorizedArray<float, 4>>::
-      internal_reinit<double>(
-        const Mapping<deal_II_dimension> &,
-        const std::vector<const hp::DoFHandler<deal_II_dimension> *> &,
-        const std::vector<const AffineConstraints<double> *> &,
-        const std::vector<IndexSet> &,
-        const std::vector<hp::QCollection<1>> &,
-        const AdditionalData &);
-
-    template void
-    MatrixFree<deal_II_dimension, float, VectorizedArray<float, 4>>::
-      internal_reinit<float>(
+    template void MatrixFree<deal_II_dimension,
+                             deal_II_scalar_vectorized::value_type,
+                             deal_II_scalar_vectorized>::
+      internal_reinit<deal_II_scalar_vectorized::value_type>(
         const Mapping<deal_II_dimension> &,
         const std::vector<const DoFHandler<deal_II_dimension> *> &,
-        const std::vector<const AffineConstraints<float> *> &,
+        const std::vector<
+          const AffineConstraints<deal_II_scalar_vectorized::value_type> *> &,
         const std::vector<IndexSet> &,
         const std::vector<hp::QCollection<1>> &,
         const AdditionalData &);
 
-    template void
-    MatrixFree<deal_II_dimension, float, VectorizedArray<float, 4>>::
-      internal_reinit<float>(
+    template void MatrixFree<deal_II_dimension,
+                             deal_II_scalar_vectorized::value_type,
+                             deal_II_scalar_vectorized>::
+      internal_reinit<deal_II_scalar_vectorized::value_type>(
         const Mapping<deal_II_dimension> &,
         const std::vector<const hp::DoFHandler<deal_II_dimension> *> &,
-        const std::vector<const AffineConstraints<float> *> &,
+        const std::vector<
+          const AffineConstraints<deal_II_scalar_vectorized::value_type> *> &,
         const std::vector<IndexSet> &,
         const std::vector<hp::QCollection<1>> &,
         const AdditionalData &);
 
     template void internal::MatrixFreeFunctions::
-      ShapeInfo<VectorizedArray<double, 2>>::reinit<deal_II_dimension>(
-        const Quadrature<1> &,
-        const FiniteElement<deal_II_dimension, deal_II_dimension> &,
-        const unsigned int);
-
-    template void internal::MatrixFreeFunctions::
-      ShapeInfo<VectorizedArray<float, 4>>::reinit<deal_II_dimension>(
+      ShapeInfo<deal_II_scalar_vectorized>::reinit<deal_II_dimension>(
         const Quadrature<1> &,
         const FiniteElement<deal_II_dimension, deal_II_dimension> &,
         const unsigned int);
-#endif
   }
 
 
-
-for (deal_II_dimension : DIMENSIONS; deal_II_space_dimension : SPACE_DIMENSIONS)
+for (deal_II_dimension : DIMENSIONS;
+     deal_II_float_vectorized : FLOAT_VECTORIZED)
   {
-#if (DEAL_II_COMPILER_VECTORIZATION_LEVEL >= 1 && defined(__SSE2__)) || \
-  (DEAL_II_COMPILER_VECTORIZATION_LEVEL >= 1 && defined(__ALTIVEC__))
-#  if deal_II_dimension <= deal_II_space_dimension
-    template bool
-    MatrixFree<deal_II_dimension, double, VectorizedArray<double, 2>>::
-      is_supported(
-        const FiniteElement<deal_II_dimension, deal_II_space_dimension> &);
-
-    template bool
-    MatrixFree<deal_II_dimension, float, VectorizedArray<float, 4>>::
-      is_supported(
-        const FiniteElement<deal_II_dimension, deal_II_space_dimension> &);
-#  endif
-#endif
-  }
-
-
-
-for (deal_II_dimension : DIMENSIONS)
-  {
-#if DEAL_II_COMPILER_VECTORIZATION_LEVEL >= 3 && defined(__AVX512F__)
-    template class MatrixFree<deal_II_dimension,
-                              double,
-                              VectorizedArray<double, 8>>;
-    template class MatrixFree<deal_II_dimension,
-                              float,
-                              VectorizedArray<float, 16>>;
-
-    template void
-    MatrixFree<deal_II_dimension, double, VectorizedArray<double, 8>>::
-      print_memory_consumption<std::ostream>(std::ostream &) const;
-
-    template void
-    MatrixFree<deal_II_dimension, double, VectorizedArray<double, 8>>::
-      print_memory_consumption<ConditionalOStream>(ConditionalOStream &) const;
-
-    template void
-    MatrixFree<deal_II_dimension, float, VectorizedArray<float, 16>>::
-      print_memory_consumption<std::ostream>(std::ostream &) const;
-
-    template void
-    MatrixFree<deal_II_dimension, float, VectorizedArray<float, 16>>::
-      print_memory_consumption<ConditionalOStream>(ConditionalOStream &) const;
-
-    template void
-    MatrixFree<deal_II_dimension, double, VectorizedArray<double, 8>>::
+    template void MatrixFree<deal_II_dimension,
+                             deal_II_float_vectorized::value_type,
+                             deal_II_float_vectorized>::
       internal_reinit<double>(
         const Mapping<deal_II_dimension> &,
         const std::vector<const DoFHandler<deal_II_dimension> *> &,
@@ -428,8 +88,9 @@ for (deal_II_dimension : DIMENSIONS)
         const std::vector<hp::QCollection<1>> &,
         const AdditionalData &);
 
-    template void
-    MatrixFree<deal_II_dimension, double, VectorizedArray<double, 8>>::
+    template void MatrixFree<deal_II_dimension,
+                             deal_II_float_vectorized::value_type,
+                             deal_II_float_vectorized>::
       internal_reinit<double>(
         const Mapping<deal_II_dimension> &,
         const std::vector<const hp::DoFHandler<deal_II_dimension> *> &,
@@ -437,76 +98,17 @@ for (deal_II_dimension : DIMENSIONS)
         const std::vector<IndexSet> &,
         const std::vector<hp::QCollection<1>> &,
         const AdditionalData &);
-
-    template void
-    MatrixFree<deal_II_dimension, float, VectorizedArray<float, 16>>::
-      internal_reinit<double>(
-        const Mapping<deal_II_dimension> &,
-        const std::vector<const DoFHandler<deal_II_dimension> *> &,
-        const std::vector<const AffineConstraints<double> *> &,
-        const std::vector<IndexSet> &,
-        const std::vector<hp::QCollection<1>> &,
-        const AdditionalData &);
-
-    template void
-    MatrixFree<deal_II_dimension, float, VectorizedArray<float, 16>>::
-      internal_reinit<double>(
-        const Mapping<deal_II_dimension> &,
-        const std::vector<const hp::DoFHandler<deal_II_dimension> *> &,
-        const std::vector<const AffineConstraints<double> *> &,
-        const std::vector<IndexSet> &,
-        const std::vector<hp::QCollection<1>> &,
-        const AdditionalData &);
-
-    template void
-    MatrixFree<deal_II_dimension, float, VectorizedArray<float, 16>>::
-      internal_reinit<float>(
-        const Mapping<deal_II_dimension> &,
-        const std::vector<const DoFHandler<deal_II_dimension> *> &,
-        const std::vector<const AffineConstraints<float> *> &,
-        const std::vector<IndexSet> &,
-        const std::vector<hp::QCollection<1>> &,
-        const AdditionalData &);
-
-    template void
-    MatrixFree<deal_II_dimension, float, VectorizedArray<float, 16>>::
-      internal_reinit<float>(
-        const Mapping<deal_II_dimension> &,
-        const std::vector<const hp::DoFHandler<deal_II_dimension> *> &,
-        const std::vector<const AffineConstraints<float> *> &,
-        const std::vector<IndexSet> &,
-        const std::vector<hp::QCollection<1>> &,
-        const AdditionalData &);
-
-    template void internal::MatrixFreeFunctions::
-      ShapeInfo<VectorizedArray<double, 8>>::reinit<deal_II_dimension>(
-        const Quadrature<1> &,
-        const FiniteElement<deal_II_dimension, deal_II_dimension> &,
-        const unsigned int);
-
-    template void internal::MatrixFreeFunctions::
-      ShapeInfo<VectorizedArray<float, 16>>::reinit<deal_II_dimension>(
-        const Quadrature<1> &,
-        const FiniteElement<deal_II_dimension, deal_II_dimension> &,
-        const unsigned int);
-#endif
   }
 
 
-
-for (deal_II_dimension : DIMENSIONS; deal_II_space_dimension : SPACE_DIMENSIONS)
+for (deal_II_dimension : DIMENSIONS; deal_II_space_dimension : SPACE_DIMENSIONS;
+     deal_II_scalar_vectorized : REAL_SCALARS_VECTORIZED)
   {
-#if DEAL_II_COMPILER_VECTORIZATION_LEVEL >= 3 && defined(__AVX512F__)
-#  if deal_II_dimension <= deal_II_space_dimension
-    template bool
-    MatrixFree<deal_II_dimension, double, VectorizedArray<double, 8>>::
-      is_supported(
-        const FiniteElement<deal_II_dimension, deal_II_space_dimension> &);
-
-    template bool
-    MatrixFree<deal_II_dimension, float, VectorizedArray<float, 16>>::
+#if deal_II_dimension <= deal_II_space_dimension
+    template bool MatrixFree<deal_II_dimension,
+                             deal_II_scalar_vectorized::value_type,
+                             deal_II_scalar_vectorized>::
       is_supported(
         const FiniteElement<deal_II_dimension, deal_II_space_dimension> &);
-#  endif
 #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.