Skip to content

Commit

Permalink
Remove another ArrayView
Browse files Browse the repository at this point in the history
  • Loading branch information
kronbichler committed May 8, 2023
1 parent 2b4a4ea commit b5a8c60
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 18 deletions.
14 changes: 7 additions & 7 deletions include/deal.II/matrix_free/fe_point_evaluation.h
Original file line number Diff line number Diff line change
Expand Up @@ -1494,6 +1494,7 @@ FEPointEvaluation<n_components, dim, spacedim, Number>::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<unsigned int &>(n_q_points) =
(n_q_points_scalar + n_lanes_user_interface - 1) / n_lanes_user_interface;

Expand Down Expand Up @@ -1533,6 +1534,7 @@ FEPointEvaluation<n_components, dim, spacedim, Number>::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();
Expand Down Expand Up @@ -1592,7 +1594,7 @@ FEPointEvaluation<n_components, dim, spacedim, Number>::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]);
}
Expand All @@ -1603,7 +1605,7 @@ FEPointEvaluation<n_components, dim, spacedim, Number>::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;
Expand Down Expand Up @@ -1764,7 +1766,7 @@ FEPointEvaluation<n_components, dim, spacedim, Number>::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]);
}
Expand All @@ -1782,7 +1784,7 @@ FEPointEvaluation<n_components, dim, spacedim, Number>::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;
Expand All @@ -1806,9 +1808,7 @@ FEPointEvaluation<n_components, dim, spacedim, Number>::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,
Expand Down
21 changes: 10 additions & 11 deletions include/deal.II/matrix_free/tensor_product_kernels.h
Original file line number Diff line number Diff line change
Expand Up @@ -3477,12 +3477,11 @@ namespace internal
DEAL_II_ALWAYS_INLINE
#endif
void
do_apply_test_functions_xy(
AlignedVector<Number2> & values,
const ArrayView<dealii::ndarray<Number, 2, dim>> &shapes,
const std::array<Number2, 3> & test_grads_value,
const int n_shapes_runtime,
int & i)
do_apply_test_functions_xy(AlignedVector<Number2> & values,
const dealii::ndarray<Number, 2, dim> *shapes,
const std::array<Number2, 3> &test_grads_value,
const int n_shapes_runtime,
int & i)
{
if (length > 0)
{
Expand Down Expand Up @@ -3544,11 +3543,11 @@ namespace internal
template <int dim, typename Number, typename Number2>
inline void
integrate_add_tensor_product_value_and_gradient_shapes(
const ArrayView<dealii::ndarray<Number, 2, dim>> &shapes,
const int n_shapes,
const Number2 & value,
const Tensor<1, dim, Number2> & gradient,
AlignedVector<Number2> & values)
const dealii::ndarray<Number, 2, dim> *shapes,
const int n_shapes,
const Number2 & value,
const Tensor<1, dim, Number2> & gradient,
AlignedVector<Number2> & values)
{
static_assert(dim >= 1 && dim <= 3, "Only dim=1,2,3 implemented");

Expand Down

0 comments on commit b5a8c60

Please sign in to comment.