avoid unnecessary copy of jacobian

This commit is contained in:
Arne Morten Kvarving 2024-08-13 11:24:59 +02:00
parent 4577469e19
commit 66747886c6
2 changed files with 4 additions and 3 deletions

View File

@ -68,8 +68,9 @@ set_context(rocsparse_handle handle_,
template <class Scalar, unsigned int block_size> template <class Scalar, unsigned int block_size>
void rocsparsePreconditioner<Scalar, block_size>:: void rocsparsePreconditioner<Scalar, block_size>::
setJacMat(BlockedMatrix<Scalar> jacMat) { setJacMat(const BlockedMatrix<Scalar>& jMat)
this->jacMat = std::make_shared<BlockedMatrix<Scalar>>(jacMat); {
this->jacMat = std::make_shared<BlockedMatrix<Scalar>>(jMat);
} }
#define INSTANTIATE_TYPE(T) \ #define INSTANTIATE_TYPE(T) \

View File

@ -84,7 +84,7 @@ public:
rocsparse_operation operation, rocsparse_operation operation,
hipStream_t stream); hipStream_t stream);
void setJacMat(BlockedMatrix<Scalar> jacMat); void setJacMat(const BlockedMatrix<Scalar>& jacMat);
}; };
} //namespace Opm } //namespace Opm