From b5a8c6050b653fbaa864a127e372bfd0d766ed93 Mon Sep 17 00:00:00 2001 From: Martin Kronbichler Date: Fri, 5 May 2023 10:45:50 +0200 Subject: [PATCH] Remove another ArrayView --- .../deal.II/matrix_free/fe_point_evaluation.h | 14 ++++++------- .../matrix_free/tensor_product_kernels.h | 21 +++++++++---------- 2 files changed, 17 insertions(+), 18 deletions(-) diff --git a/include/deal.II/matrix_free/fe_point_evaluation.h b/include/deal.II/matrix_free/fe_point_evaluation.h index b22152cd7c..9efda1086b 100644 --- a/include/deal.II/matrix_free/fe_point_evaluation.h +++ b/include/deal.II/matrix_free/fe_point_evaluation.h @@ -1494,6 +1494,7 @@ FEPointEvaluation::do_reinit() mapping_info->get_n_q_points_unvectorized(current_cell_index, current_face_number); + // round up n_points_scalar / n_lanes_user_interface const_cast(n_q_points) = (n_q_points_scalar + n_lanes_user_interface - 1) / n_lanes_user_interface; @@ -1533,6 +1534,7 @@ FEPointEvaluation::do_reinit() if (fast_path && !polynomials_are_hat_functions) { + // round up n_q_points_scalar / n_lanes_internal const std::size_t n_batches = (n_q_points_scalar + n_lanes_internal - 1) / n_lanes_internal; const std::size_t n_shapes = poly.size(); @@ -1592,7 +1594,7 @@ FEPointEvaluation::evaluate_fast( if (evaluation_flags & EvaluationFlags::values) { for (unsigned int v = 0; - v < stride && (stride > 1 ? q + v < n_q_points_scalar : true); + v < stride && (stride == 1 || q + v < n_q_points_scalar); ++v) ETT::set_value(val_and_grad.first, v, values[qb * stride + v]); } @@ -1603,7 +1605,7 @@ FEPointEvaluation::evaluate_fast( ExcNotInitialized()); for (unsigned int v = 0; - v < stride && (stride > 1 ? q + v < n_q_points_scalar : true); + v < stride && (stride == 1 || q + v < n_q_points_scalar); ++v) { const unsigned int offset = qb * stride + v; @@ -1764,7 +1766,7 @@ FEPointEvaluation::integrate_fast( } for (unsigned int v = 0; - v < stride && (stride > 1 ? q + v < n_q_points_scalar : true); + v < stride && (stride == 1 || q + v < n_q_points_scalar); ++v) ETT::get_value(value, v, values[qb * stride + v]); } @@ -1782,7 +1784,7 @@ FEPointEvaluation::integrate_fast( } for (unsigned int v = 0; - v < stride && (stride > 1 ? q + v < n_q_points_scalar : true); + v < stride && (stride == 1 || q + v < n_q_points_scalar); ++v) { const unsigned int offset = qb * stride + v; @@ -1806,9 +1808,7 @@ FEPointEvaluation::integrate_fast( internal::integrate_add_tensor_product_value_and_gradient_shapes< dim, VectorizedArrayType, - vectorized_value_type>(make_array_view(shapes, - qb * n_shapes, - n_shapes), + vectorized_value_type>(shapes.data() + qb * n_shapes, n_shapes, value, gradient, diff --git a/include/deal.II/matrix_free/tensor_product_kernels.h b/include/deal.II/matrix_free/tensor_product_kernels.h index db7732e636..20ae6672ee 100644 --- a/include/deal.II/matrix_free/tensor_product_kernels.h +++ b/include/deal.II/matrix_free/tensor_product_kernels.h @@ -3477,12 +3477,11 @@ namespace internal DEAL_II_ALWAYS_INLINE #endif void - do_apply_test_functions_xy( - AlignedVector & values, - const ArrayView> &shapes, - const std::array & test_grads_value, - const int n_shapes_runtime, - int & i) + do_apply_test_functions_xy(AlignedVector & values, + const dealii::ndarray *shapes, + const std::array &test_grads_value, + const int n_shapes_runtime, + int & i) { if (length > 0) { @@ -3544,11 +3543,11 @@ namespace internal template inline void integrate_add_tensor_product_value_and_gradient_shapes( - const ArrayView> &shapes, - const int n_shapes, - const Number2 & value, - const Tensor<1, dim, Number2> & gradient, - AlignedVector & values) + const dealii::ndarray *shapes, + const int n_shapes, + const Number2 & value, + const Tensor<1, dim, Number2> & gradient, + AlignedVector & values) { static_assert(dim >= 1 && dim <= 3, "Only dim=1,2,3 implemented"); -- 2.39.5