From: Peter Munch Date: Mon, 10 Oct 2022 13:59:58 +0000 (+0200) Subject: Add process_dofs_vectorized_transpose() variants with constant_offset X-Git-Tag: v9.5.0-rc1~165^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9c261e6b9ee8a5adba4ea1a29bfef731c19f0d14;p=dealii.git Add process_dofs_vectorized_transpose() variants with constant_offset --- diff --git a/include/deal.II/matrix_free/vector_access_internal.h b/include/deal.II/matrix_free/vector_access_internal.h index abc647baab..ca9f738a3c 100644 --- a/include/deal.II/matrix_free/vector_access_internal.h +++ b/include/deal.II/matrix_free/vector_access_internal.h @@ -348,11 +348,12 @@ namespace internal process_dofs_vectorized_transpose(const unsigned int dofs_per_cell, const unsigned int * dof_indices, VectorType & vec, + const unsigned int constant_offset, VectorizedArrayType *dof_values, std::integral_constant) const { dealii::vectorized_load_and_transpose(dofs_per_cell, - vec.begin(), + vec.begin() + constant_offset, dof_indices, dof_values); } @@ -364,12 +365,44 @@ namespace internal process_dofs_vectorized_transpose(const unsigned int dofs_per_cell, const unsigned int * dof_indices, const VectorType & vec, + const unsigned int constant_offset, VectorizedArrayType *dof_values, std::integral_constant) const { for (unsigned int d = 0; d < dofs_per_cell; ++d) for (unsigned int v = 0; v < VectorizedArrayType::size(); ++v) - dof_values[d][v] = vector_access(vec, dof_indices[v] + d); + dof_values[d][v] = + vector_access(vec, dof_indices[v] + constant_offset + d); + } + + + + template + void + process_dofs_vectorized_transpose( + const unsigned int dofs_per_cell, + const unsigned int * dof_indices, + VectorType & vec, + VectorizedArrayType * dof_values, + std::integral_constant type) const + { + process_dofs_vectorized_transpose( + dofs_per_cell, dof_indices, vec, 0, dof_values, type); + } + + + + template + void + process_dofs_vectorized_transpose( + const unsigned int dofs_per_cell, + const unsigned int * dof_indices, + const VectorType & vec, + VectorizedArrayType * dof_values, + std::integral_constant type) const + { + process_dofs_vectorized_transpose( + dofs_per_cell, dof_indices, vec, 0, dof_values, type); } @@ -556,11 +589,15 @@ namespace internal process_dofs_vectorized_transpose(const unsigned int dofs_per_cell, const unsigned int * dof_indices, VectorType & vec, + const unsigned int constant_offset, VectorizedArrayType *dof_values, std::integral_constant) const { - vectorized_transpose_and_store( - true, dofs_per_cell, dof_values, dof_indices, vec.begin()); + vectorized_transpose_and_store(true, + dofs_per_cell, + dof_values, + dof_indices, + vec.begin() + constant_offset); } @@ -570,12 +607,45 @@ namespace internal process_dofs_vectorized_transpose(const unsigned int dofs_per_cell, const unsigned int * dof_indices, VectorType & vec, + const unsigned int constant_offset, VectorizedArrayType *dof_values, std::integral_constant) const { for (unsigned int d = 0; d < dofs_per_cell; ++d) for (unsigned int v = 0; v < VectorizedArrayType::size(); ++v) - vector_access_add(vec, dof_indices[v] + d, dof_values[d][v]); + vector_access_add(vec, + dof_indices[v] + constant_offset + d, + dof_values[d][v]); + } + + + + template + void + process_dofs_vectorized_transpose( + const unsigned int dofs_per_cell, + const unsigned int * dof_indices, + VectorType & vec, + VectorizedArrayType * dof_values, + std::integral_constant type) const + { + process_dofs_vectorized_transpose( + dofs_per_cell, dof_indices, vec, 0, dof_values, type); + } + + + + template + void + process_dofs_vectorized_transpose( + const unsigned int dofs_per_cell, + const unsigned int * dof_indices, + VectorType & vec, + VectorizedArrayType * dof_values, + std::integral_constant type) const + { + process_dofs_vectorized_transpose( + dofs_per_cell, dof_indices, vec, 0, dof_values, type); } @@ -752,11 +822,15 @@ namespace internal process_dofs_vectorized_transpose(const unsigned int dofs_per_cell, const unsigned int * dof_indices, VectorType & vec, + const unsigned int constant_offset, VectorizedArrayType *dof_values, std::integral_constant) const { - vectorized_transpose_and_store( - false, dofs_per_cell, dof_values, dof_indices, vec.begin()); + vectorized_transpose_and_store(false, + dofs_per_cell, + dof_values, + dof_indices, + vec.begin() + constant_offset); } @@ -766,12 +840,44 @@ namespace internal process_dofs_vectorized_transpose(const unsigned int dofs_per_cell, const unsigned int * dof_indices, VectorType & vec, + const unsigned int constant_offset, VectorizedArrayType *dof_values, std::integral_constant) const { for (unsigned int i = 0; i < dofs_per_cell; ++i) for (unsigned int v = 0; v < VectorizedArrayType::size(); ++v) - vector_access(vec, dof_indices[v] + i) = dof_values[i][v]; + vector_access(vec, constant_offset + dof_indices[v] + i) = + dof_values[i][v]; + } + + + + template + void + process_dofs_vectorized_transpose( + const unsigned int dofs_per_cell, + const unsigned int * dof_indices, + VectorType & vec, + VectorizedArrayType * dof_values, + std::integral_constant type) const + { + process_dofs_vectorized_transpose( + dofs_per_cell, dof_indices, vec, 0, dof_values, type); + } + + + + template + void + process_dofs_vectorized_transpose( + const unsigned int dofs_per_cell, + const unsigned int * dof_indices, + VectorType & vec, + VectorizedArrayType * dof_values, + std::integral_constant type) const + { + process_dofs_vectorized_transpose( + dofs_per_cell, dof_indices, vec, 0, dof_values, type); }