diff --git a/CHANGELOG.md b/CHANGELOG.md index 35747bd9..b02211f9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -63,3 +63,5 @@ It is seamless from the user perspective and fixed many bugs. 14. Various Spack updates. 15. Added examples/sysGmres.cpp to demonstrate how to use SystemSolver with GMRES. + +16. Updated MatrixHandler::addConst to return integer error codes instead of void. diff --git a/resolve/matrix/MatrixHandler.cpp b/resolve/matrix/MatrixHandler.cpp index 1d570af8..aec483a1 100644 --- a/resolve/matrix/MatrixHandler.cpp +++ b/resolve/matrix/MatrixHandler.cpp @@ -337,18 +337,19 @@ namespace ReSolve * @param[in] memspace - Device where the operation is computed * @return 0 if successful, 1 otherwise */ - void MatrixHandler::addConst(matrix::Sparse* A, real_type alpha, memory::MemorySpace memspace) + int MatrixHandler::addConst(matrix::Sparse* A, real_type alpha, memory::MemorySpace memspace) { using namespace ReSolve::memory; switch (memspace) { case HOST: - cpuImpl_->addConst(A, alpha); + return cpuImpl_->addConst(A, alpha); break; case DEVICE: - devImpl_->addConst(A, alpha); + return devImpl_->addConst(A, alpha); break; } + return 1; } /** diff --git a/resolve/matrix/MatrixHandler.hpp b/resolve/matrix/MatrixHandler.hpp index 6b6785ab..8be29730 100644 --- a/resolve/matrix/MatrixHandler.hpp +++ b/resolve/matrix/MatrixHandler.hpp @@ -60,7 +60,7 @@ namespace ReSolve int rightScale(matrix::Csr* A, vector_type* diag, memory::MemorySpace memspace); - void addConst(matrix::Sparse* A, real_type alpha, memory::MemorySpace memspace); + int addConst(matrix::Sparse* A, real_type alpha, memory::MemorySpace memspace); /// Should compute vec_result := alpha*A*vec_x + beta*vec_result, but at least on cpu alpha and beta are flipped int matvec(matrix::Sparse* A,