From: Martin Kronbichler Date: Wed, 16 Feb 2022 16:27:01 +0000 (+0100) Subject: Improve instruction-level parallelism for precondition_SSOR X-Git-Tag: v9.4.0-rc1~479^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f5f0f2cae3e3f2ccd90ababf70a0cb41910a5d6a;p=dealii.git Improve instruction-level parallelism for precondition_SSOR --- diff --git a/include/deal.II/lac/sparse_matrix.templates.h b/include/deal.II/lac/sparse_matrix.templates.h index 74fba0265f..cd512ff7b8 100644 --- a/include/deal.II/lac/sparse_matrix.templates.h +++ b/include/deal.II/lac/sparse_matrix.templates.h @@ -1501,7 +1501,11 @@ SparseMatrix::precondition_SSOR( const size_type first_right_of_diagonal_index = pos_right_of_diagonal[row]; number s = 0; - for (size_type j = first_right_of_diagonal_index; j < end_row; ++j) + // go through the column from the end towards the diagonal in order + // to delay the use of the newly computed "dst" values on + // out-of-order-execution hardware + for (size_type j = end_row - 1; j >= first_right_of_diagonal_index; + --j) s += val[j] * number(dst(cols->colnums[j])); *dst_ptr -= s * omega;