From: Martin Kronbichler Date: Sat, 28 Mar 2020 21:56:53 +0000 (+0100) Subject: Avoid deprecated VectorizedArray::n_array_elements X-Git-Tag: v9.2.0-rc1~337^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=264e385c2f33bc99048d9794d8642785503d077e;p=dealii.git Avoid deprecated VectorizedArray::n_array_elements --- diff --git a/include/deal.II/matrix_free/mapping_info.h b/include/deal.II/matrix_free/mapping_info.h index 30040fd4a7..7e31172d16 100644 --- a/include/deal.II/matrix_free/mapping_info.h +++ b/include/deal.II/matrix_free/mapping_info.h @@ -466,8 +466,8 @@ namespace internal compute_mapping_q( const dealii::Triangulation & tria, const std::vector> &cells, - const std::vector< - FaceToCellTopology> &faces); + const std::vector> + &faces); /** * Computes the information in the given cells, called within diff --git a/include/deal.II/matrix_free/mapping_info.templates.h b/include/deal.II/matrix_free/mapping_info.templates.h index 5788897420..ee0d69757f 100644 --- a/include/deal.II/matrix_free/mapping_info.templates.h +++ b/include/deal.II/matrix_free/mapping_info.templates.h @@ -415,12 +415,12 @@ namespace internal const unsigned int offset, VectorizedArrayType2 & result) { - static_assert(VectorizedArrayType2::n_array_elements >= - VectorizedArrayType1::n_array_elements, + static_assert(VectorizedArrayType2::size() >= + VectorizedArrayType1::size(), "Cannot convert to vectorized array of wider number type"); DEAL_II_OPENMP_SIMD_PRAGMA - for (unsigned int v = 0; v < VectorizedArrayType1::n_array_elements; ++v) + for (unsigned int v = 0; v < VectorizedArrayType1::size(); ++v) result[offset + v] = value[v]; } @@ -967,20 +967,15 @@ namespace internal if (mapping_info.get_cell_type(cell) < general) { Point quad_point; - for (unsigned int v = 0; - v < VectorizedArrayType::n_array_elements; + for (unsigned int v = 0; v < VectorizedArrayType::size(); ++v) { typename dealii::Triangulation::cell_iterator cell_it( &tria, - cells[cell * - VectorizedArrayType::n_array_elements + - v] + cells[cell * VectorizedArrayType::size() + v] .first, - cells[cell * - VectorizedArrayType::n_array_elements + - v] + cells[cell * VectorizedArrayType::size() + v] .second); const Point p = mapping.transform_unit_to_real_cell(cell_it, @@ -1125,8 +1120,8 @@ namespace internal const ShapeInfo &shape_info, MappingInfoStorage &my_data) { - constexpr unsigned int n_lanes = VectorizedArrayType::n_array_elements; - constexpr unsigned int n_lanes_d = VectorizedDouble::n_array_elements; + constexpr unsigned int n_lanes = VectorizedArrayType::size(); + constexpr unsigned int n_lanes_d = VectorizedDouble::size(); const unsigned int n_q_points = my_data.descriptor[0].n_q_points; const unsigned int n_mapping_points = @@ -1146,8 +1141,7 @@ namespace internal { if (cell_type[cell] > affine || process_cell[cell]) { - unsigned int - start_indices[VectorizedDouble::n_array_elements]; + unsigned int start_indices[n_lanes_d]; for (unsigned int v = 0; v < n_lanes_d; ++v) start_indices[v] = (cell * n_lanes + vv + v) * n_mapping_points * dim; @@ -1935,17 +1929,17 @@ namespace internal compute_range_mapping_q( const unsigned int begin_face, const unsigned int end_face, - const std::vector< - FaceToCellTopology> &faces, - const std::vector & face_type, + const std::vector> + & faces, + const std::vector & face_type, const std::vector & process_face, const UpdateFlags update_flags_faces, const AlignedVector & plain_quadrature_points, const ShapeInfo &shape_info, MappingInfoStorage &my_data) { - constexpr unsigned int n_lanes = VectorizedArrayType::n_array_elements; - constexpr unsigned int n_lanes_d = VectorizedDouble::n_array_elements; + constexpr unsigned int n_lanes = VectorizedArrayType::size(); + constexpr unsigned int n_lanes_d = VectorizedDouble::size(); const unsigned int n_q_points = my_data.descriptor[0].n_q_points; const unsigned int n_mapping_points = @@ -1961,7 +1955,7 @@ namespace internal for (unsigned vv = 0; vv < n_lanes; vv += n_lanes_d) { // load the geometry field for all SIMD lanes - unsigned int start_indices[VectorizedDouble::n_array_elements]; + unsigned int start_indices[n_lanes_d]; const unsigned int face_no = faces[face].interior_face_no; for (unsigned int v = 0; v < n_lanes_d; ++v) if (faces[face].cells_interior[vv + v] != @@ -2356,8 +2350,7 @@ namespace internal MappingInfo::compute_mapping_q( const dealii::Triangulation & tria, const std::vector> &cell_array, - const std::vector< - FaceToCellTopology> &faces) + const std::vector> &faces) { // step 1: extract quadrature point data with the data appropriate for // MappingQGeneric @@ -2489,7 +2482,7 @@ namespace internal // We want to use vectorization for computing the quantities, but must // evaluate the geometry in double precision; thus, for floats we need // to do things in two sweeps and convert the final result. - constexpr unsigned int n_lanes = VectorizedArrayType::n_array_elements; + constexpr unsigned int n_lanes = VectorizedArrayType::size(); using VectorizedDouble = VectorizedArray::value && n_lanes > 1) ?