From: Matthias Maier Date: Tue, 2 Apr 2024 20:55:11 +0000 (-0500) Subject: VectorizedArray: add constexpr boolean that records whether a type is vectorized X-Git-Tag: v9.6.0-rc1~400^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F16840%2Fhead;p=dealii.git VectorizedArray: add constexpr boolean that records whether a type is vectorized --- diff --git a/include/deal.II/base/vectorization.h b/include/deal.II/base/vectorization.h index c6603069ad..e81f4bad6c 100644 --- a/include/deal.II/base/vectorization.h +++ b/include/deal.II/base/vectorization.h @@ -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.