From c7bfde6ebc3c98d11b4d9904b49cd657f7fbea92 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Oberhuber?= <oberhuber.tomas@gmail.com> Date: Thu, 4 Feb 2021 15:15:00 +0100 Subject: [PATCH] Fixed matrix vector multiplication for symmetric sparse matrices. --- src/TNL/Matrices/SparseMatrixView.hpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/TNL/Matrices/SparseMatrixView.hpp b/src/TNL/Matrices/SparseMatrixView.hpp index 8007ebd269..1a55a22c43 100644 --- a/src/TNL/Matrices/SparseMatrixView.hpp +++ b/src/TNL/Matrices/SparseMatrixView.hpp @@ -424,7 +424,10 @@ vectorProduct( const InVector& inVector, auto keeper = [=] __cuda_callable__ ( IndexType row, const ComputeRealType& value ) mutable { if( isSymmetric() ) - outVectorView[ row ] += matrixMultiplicator * value; + { + typename OutVector::RealType aux = matrixMultiplicator * value; + Algorithms::AtomicOperations< DeviceType >::add( outVectorView[ row ], aux ); + } else { if( outVectorMultiplicator == 0.0 ) -- GitLab