From: Peter Munch Date: Mon, 21 Mar 2022 19:14:49 +0000 (+0100) Subject: GC: compressed weights -> AlignedVector X-Git-Tag: v9.4.0-rc1~354^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F13557%2Fhead;p=dealii.git GC: compressed weights -> AlignedVector --- diff --git a/include/deal.II/multigrid/mg_transfer_global_coarsening.h b/include/deal.II/multigrid/mg_transfer_global_coarsening.h index b72b71e879..7b93d0e367 100644 --- a/include/deal.II/multigrid/mg_transfer_global_coarsening.h +++ b/include/deal.II/multigrid/mg_transfer_global_coarsening.h @@ -442,8 +442,7 @@ private: * Weights for continuous elements, compressed into 3^dim doubles per * cell if possible. */ - std::vector, Utilities::pow(3, dim)>> - weights_compressed; + AlignedVector> weights_compressed; /** * DoF indices of the fine cells, expressed in indices local to the MPI diff --git a/include/deal.II/multigrid/mg_transfer_global_coarsening.templates.h b/include/deal.II/multigrid/mg_transfer_global_coarsening.templates.h index f6aef50550..62a10e09f2 100644 --- a/include/deal.II/multigrid/mg_transfer_global_coarsening.templates.h +++ b/include/deal.II/multigrid/mg_transfer_global_coarsening.templates.h @@ -1221,8 +1221,7 @@ namespace internal } // vectorize weights - std::vector, Utilities::pow(3, dim)>> - masks_vectorized; + AlignedVector> masks_vectorized; const unsigned int n_lanes = VectorizedArray::size(); @@ -1239,6 +1238,7 @@ namespace internal n_lanes; std::array, Utilities::pow(3, dim)> mask; + mask.fill(VectorizedArray()); for (unsigned int v = 0; v < n_lanes_filled; ++v, ++c) { @@ -1248,7 +1248,7 @@ namespace internal mask[i][v] = masks[c][i]; } - masks_vectorized.push_back(mask); + masks_vectorized.insert_back(mask.begin(), mask.end()); } } @@ -2490,10 +2490,9 @@ MGTwoLevelTransfer>:: AlignedVector evaluation_data_fine; AlignedVector evaluation_data_coarse; - const unsigned int *indices_fine = level_dof_indices_fine.data(); - const Number * weights = nullptr; - const std::array, Utilities::pow(3, dim)> - *weights_compressed = nullptr; + const unsigned int * indices_fine = level_dof_indices_fine.data(); + const Number * weights = nullptr; + const VectorizedArray *weights_compressed = nullptr; if (fine_element_is_continuous) { @@ -2568,11 +2567,11 @@ MGTwoLevelTransfer>:: if (fine_element_is_continuous && this->weights_compressed.size() > 0) { internal::weight_fe_q_dofs_by_entity( - weights_compressed->data(), + weights_compressed, n_components, scheme.degree_fine + 1, evaluation_data_fine.begin()); - weights_compressed += 1; + weights_compressed += Utilities::pow(3, dim); } for (unsigned int v = 0; v < n_lanes_filled; ++v) @@ -2642,10 +2641,9 @@ MGTwoLevelTransfer>:: AlignedVector evaluation_data_fine; AlignedVector evaluation_data_coarse; - const unsigned int *indices_fine = level_dof_indices_fine.data(); - const Number * weights = nullptr; - const std::array, Utilities::pow(3, dim)> - *weights_compressed = nullptr; + const unsigned int * indices_fine = level_dof_indices_fine.data(); + const Number * weights = nullptr; + const VectorizedArray *weights_compressed = nullptr; if (fine_element_is_continuous) { @@ -2704,11 +2702,11 @@ MGTwoLevelTransfer>:: if (fine_element_is_continuous && this->weights_compressed.size() > 0) { internal::weight_fe_q_dofs_by_entity( - weights_compressed->data(), + weights_compressed, n_components, scheme.degree_fine + 1, evaluation_data_fine.begin()); - weights_compressed += 1; + weights_compressed += Utilities::pow(3, dim); } // ------------------------------ fine -------------------------------