]> https://gitweb.dealii.org/ - dealii.git/commitdiff
VectorizedArray: add constexpr boolean that records whether a type is vectorized 16840/head
authorMatthias Maier <tamiko@43-1.org>
Tue, 2 Apr 2024 20:55:11 +0000 (15:55 -0500)
committerMatthias Maier <tamiko@43-1.org>
Wed, 3 Apr 2024 23:01:58 +0000 (18:01 -0500)
include/deal.II/base/vectorization.h

index c6603069adfa454ee5ad017e8ae8256ed17efd23..e81f4bad6ce559d384258f2e682e9466a473625c 100644 (file)
@@ -455,6 +455,16 @@ public:
    */
   using value_type = Number;
 
+  /**
+   * A constexpr boolean indicating whether the VectorizedArray with the
+   * given choice of template parameters @p Number and @p width is indeed
+   * implemented. The generic implementation is only implemented for
+   * @p width equal to one. For specializations of this class (which are
+   * defined depending on the instruction sets available) the boolean is
+   * set to true as well.
+   */
+  static constexpr bool is_implemented = (width == 1);
+
   /**
    * Default empty constructor, leaving the data in an uninitialized state
    * similar to float/double.
@@ -1014,6 +1024,12 @@ public:
    */
   using value_type = double;
 
+  /**
+   * Record the fact that the given specialization of VectorizedArray is
+   * indeed implemented.
+   */
+  static constexpr bool is_implemented = true;
+
   /**
    * Default empty constructor, leaving the data in an uninitialized state
    * similar to float/double.
@@ -1300,6 +1316,12 @@ public:
    */
   using value_type = float;
 
+  /**
+   * Record the fact that the given specialization of VectorizedArray is
+   * indeed implemented.
+   */
+  static constexpr bool is_implemented = true;
+
   /**
    * Default empty constructor, leaving the data in an uninitialized state
    * similar to float/double.
@@ -1573,6 +1595,12 @@ public:
    */
   using value_type = double;
 
+  /**
+   * Record the fact that the given specialization of VectorizedArray is
+   * indeed implemented.
+   */
+  static constexpr bool is_implemented = true;
+
   /**
    * Default empty constructor, leaving the data in an uninitialized state
    * similar to float/double.
@@ -2058,6 +2086,12 @@ public:
    */
   using value_type = float;
 
+  /**
+   * Record the fact that the given specialization of VectorizedArray is
+   * indeed implemented.
+   */
+  static constexpr bool is_implemented = true;
+
   /**
    * Default empty constructor, leaving the data in an uninitialized state
    * similar to float/double.
@@ -2566,6 +2600,12 @@ public:
    */
   using value_type = double;
 
+  /**
+   * Record the fact that the given specialization of VectorizedArray is
+   * indeed implemented.
+   */
+  static constexpr bool is_implemented = true;
+
   /**
    * Default empty constructor, leaving the data in an uninitialized state
    * similar to float/double.
@@ -3144,6 +3184,12 @@ public:
    */
   using value_type = float;
 
+  /**
+   * Record the fact that the given specialization of VectorizedArray is
+   * indeed implemented.
+   */
+  static constexpr bool is_implemented = true;
+
   /**
    * Default empty constructor, leaving the data in an uninitialized state
    * similar to float/double.
@@ -3745,6 +3791,12 @@ public:
    */
   using value_type = double;
 
+  /**
+   * Record the fact that the given specialization of VectorizedArray is
+   * indeed implemented.
+   */
+  static constexpr bool is_implemented = true;
+
   /**
    * Default empty constructor, leaving the data in an uninitialized state
    * similar to float/double.
@@ -4375,6 +4427,12 @@ public:
    */
   using value_type = float;
 
+  /**
+   * Record the fact that the given specialization of VectorizedArray is
+   * indeed implemented.
+   */
+  static constexpr bool is_implemented = true;
+
   /**
    * Default empty constructor, leaving the data in an uninitialized state
    * similar to float/double.
@@ -5084,6 +5142,12 @@ public:
    */
   using value_type = double;
 
+  /**
+   * Record the fact that the given specialization of VectorizedArray is
+   * indeed implemented.
+   */
+  static constexpr bool is_implemented = true;
+
   /**
    * Default empty constructor, leaving the data in an uninitialized state
    * similar to float/double.
@@ -5339,6 +5403,12 @@ public:
    */
   using value_type = float;
 
+  /**
+   * Record the fact that the given specialization of VectorizedArray is
+   * indeed implemented.
+   */
+  static constexpr bool is_implemented = true;
+
   /**
    * Default empty constructor, leaving the data in an uninitialized state
    * similar to float/double.

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.