Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Alternative way to avoid warnings. #13091

Merged
merged 1 commit into from
Dec 16, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
9 changes: 4 additions & 5 deletions include/deal.II/matrix_free/fe_evaluation.h
Original file line number Diff line number Diff line change
Expand Up @@ -3666,7 +3666,10 @@ FEEvaluationBase<dim, n_components_, Number, is_face, VectorizedArrayType>::
return;
}

const unsigned int *dof_indices[n_lanes];
// Allocate pointers, then initialize all of them to nullptrs and
// below overwrite the ones we actually use:
std::array<const unsigned int *, n_lanes> dof_indices;
dof_indices.fill(nullptr);

// Assign the appropriate cell ids for face/cell case and get the pointers
// to the dof indices of the cells on all lanes
Expand Down Expand Up @@ -3706,8 +3709,6 @@ FEEvaluationBase<dim, n_components_, Number, is_face, VectorizedArrayType>::
dof_indices[v] =
this->dof_info->dof_indices.data() + my_index_start[0].first;
}
for (unsigned int v = n_vectorization_actual; v < n_lanes; ++v)
dof_indices[v] = nullptr;
}
else
{
Expand Down Expand Up @@ -3740,8 +3741,6 @@ FEEvaluationBase<dim, n_components_, Number, is_face, VectorizedArrayType>::
dof_indices[v] =
this->dof_info->dof_indices.data() + my_index_start[0].first;
}
for (unsigned int v = n_vectorization_actual; v < n_lanes; ++v)
dof_indices[v] = nullptr;
}

// Case where we have no constraints throughout the whole cell: Can go
Expand Down