Added sanity check.

This commit is contained in:
Kjetil Olsen Lye 2023-05-30 10:28:29 +02:00
parent a8dd329307
commit ed2747db1c

View File

@ -75,6 +75,9 @@ CuSparseMatrix<T>::CuSparseMatrix(const T* nonZeroElements,
, m_matrixDescription(detail::createMatrixDescription())
, m_cusparseHandle(detail::CuSparseHandle::getInstance())
{
if (detail::to_size_t(rowIndices[numberOfRows]) != numberOfNonzeroBlocks) {
OPM_THROW(std::invalid_argument, "Wrong sparsity format. Needs to be CSR compliant. ");
}
}
template <class T>