From: Maximilian Bergbauer Date: Fri, 8 Jul 2022 14:22:33 +0000 (+0200) Subject: Chose correct code path for neighbors and activated mask X-Git-Tag: v9.5.0-rc1~1104^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9831d2a8fae97e88c6f5ef1a63a2e8edb8aaf3a6;p=dealii.git Chose correct code path for neighbors and activated mask --- diff --git a/include/deal.II/matrix_free/fe_evaluation.h b/include/deal.II/matrix_free/fe_evaluation.h index a57f720e59..07dae56eb4 100644 --- a/include/deal.II/matrix_free/fe_evaluation.h +++ b/include/deal.II/matrix_free/fe_evaluation.h @@ -3346,9 +3346,11 @@ FEEvaluationBase:: std::array cells = this->get_cell_ids(); - for (unsigned int v = 0; v < n_lanes; ++v) - if (mask[v] == false) - cells[v] = numbers::invalid_unsigned_int; + const bool masking_is_active = mask.count() < n_lanes; + if (masking_is_active) + for (unsigned int v = 0; v < n_lanes; ++v) + if (mask[v] == false) + cells[v] = numbers::invalid_unsigned_int; bool has_hn_constraints = false; @@ -3370,6 +3372,10 @@ FEEvaluationBase:: internal::is_vectorizable::value> vector_selector; + const bool is_neighbor_cells = !is_face && !this->is_interior_face(); + const bool use_non_vectorized_path = + masking_is_active || is_neighbor_cells || has_hn_constraints; + const std::size_t dofs_per_component = this->data->dofs_per_component_on_cell; std::array values_dofs; for (unsigned int c = 0; c < n_components; ++c) @@ -3382,7 +3388,7 @@ FEEvaluationBase:: internal::MatrixFreeFunctions::DoFInfo::dof_access_cell] [this->cell] == internal::MatrixFreeFunctions::DoFInfo:: IndexStorageVariants::interleaved && - (has_hn_constraints == false)) + (use_non_vectorized_path == false)) { const unsigned int *dof_indices = this->dof_info->dof_indices_interleaved.data() +