From c955cb5c33e73221dbc90345476184a356cebca2 Mon Sep 17 00:00:00 2001 From: Martin Kronbichler Date: Tue, 30 Nov 2021 09:14:35 +0100 Subject: [PATCH] Use narrowest possible SIMD vector for MappingQ::InternalData --- include/deal.II/fe/mapping_q.h | 22 +++++++++++++++------- include/deal.II/fe/mapping_q_internal.h | 7 +++++-- 2 files changed, 20 insertions(+), 9 deletions(-) diff --git a/include/deal.II/fe/mapping_q.h b/include/deal.II/fe/mapping_q.h index 7cf2303251..15be913847 100644 --- a/include/deal.II/fe/mapping_q.h +++ b/include/deal.II/fe/mapping_q.h @@ -474,43 +474,51 @@ public: */ QGaussLobatto<1> line_support_points; + /** + * A vectorized array type to reflect the necessary number of components + * for all interpolations to be done by this class. + */ + using VectorizedArrayType = + VectorizedArray(VectorizedArray::size(), + (dim <= 2 ? 2 : 4))>; + /** * In case the quadrature rule given represents a tensor product * we need to store the evaluations of the 1d polynomials at * the 1d quadrature points. That is what this variable is for. */ - internal::MatrixFreeFunctions::ShapeInfo> - shape_info; + internal::MatrixFreeFunctions::ShapeInfo shape_info; /** * In case the quadrature rule given represents a tensor product * we need to store temporary data in this object. */ - mutable AlignedVector> scratch; + mutable AlignedVector scratch; /** * In case the quadrature rule given represents a tensor product * the values at the mapped support points are stored in this object. */ - mutable AlignedVector> values_dofs; + mutable AlignedVector values_dofs; /** * In case the quadrature rule given represents a tensor product * the values at the quadrature points are stored in this object. */ - mutable AlignedVector> values_quad; + mutable AlignedVector values_quad; /** * In case the quadrature rule given represents a tensor product * the gradients at the quadrature points are stored in this object. */ - mutable AlignedVector> gradients_quad; + mutable AlignedVector gradients_quad; /** * In case the quadrature rule given represents a tensor product * the hessians at the quadrature points are stored in this object. */ - mutable AlignedVector> hessians_quad; + mutable AlignedVector hessians_quad; /** * Indicates whether the given Quadrature object is a tensor product. diff --git a/include/deal.II/fe/mapping_q_internal.h b/include/deal.II/fe/mapping_q_internal.h index 3f432f3bcd..9df99a0404 100644 --- a/include/deal.II/fe/mapping_q_internal.h +++ b/include/deal.II/fe/mapping_q_internal.h @@ -1079,9 +1079,12 @@ namespace internal { const UpdateFlags update_flags = data.update_each; + using VectorizedArrayType = + typename dealii::MappingQ::InternalData::VectorizedArrayType; const unsigned int n_shape_values = data.n_shape_functions; const unsigned int n_q_points = data.shape_info.n_q_points; - constexpr unsigned int n_lanes = VectorizedArray::size(); + constexpr unsigned int n_lanes = VectorizedArrayType::size(); constexpr unsigned int n_comp = 1 + (spacedim - 1) / n_lanes; constexpr unsigned int n_hessians = (dim * (dim + 1)) / 2; @@ -1148,7 +1151,7 @@ namespace internal } // do the actual tensorized evaluation - internal::FEEvaluationFactory>:: + internal::FEEvaluationFactory:: evaluate(n_comp, evaluation_flag, data.shape_info, -- 2.39.5