/*
Copyright 2024 Equinor ASA
This file is part of the Open Porous Media project (OPM).
OPM is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OPM is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with OPM. If not, see .
*/
#include
#include
#include
#include
#include
// #include
#include
namespace Opm::Accelerator {
template
std::unique_ptr > rocsparsePreconditioner::
create(PreconditionerType type, int verbosity) {
if (type == PreconditionerType::BILU0) {
return std::make_unique >(verbosity);
// } else if (type == PreconditionerType::CPR) {
// return std::make_unique >(verbosity);
} else {
OPM_THROW(std::logic_error, "Invalid PreconditionerType");
}
}
template
void rocsparsePreconditioner::
set_matrix_analysis(rocsparse_mat_descr descr_L, rocsparse_mat_descr descr_U) {
descr_L = descr_L;
descr_U = descr_U;
}
template
void rocsparsePreconditioner::
set_context(rocsparse_handle handle, rocsparse_direction dir, rocsparse_operation operation, hipStream_t stream) {
this->handle = handle;
this->dir = dir;
this->operation = operation;
this->stream = stream;
}
template
void rocsparsePreconditioner::
setJacMat(BlockedMatrix jacMat) {
this->jacMat = std::make_shared>(jacMat);
}
#define INSTANTIATE_TYPE(T) \
template class rocsparsePreconditioner; \
template class rocsparsePreconditioner; \
template class rocsparsePreconditioner; \
template class rocsparsePreconditioner; \
template class rocsparsePreconditioner; \
template class rocsparsePreconditioner;
INSTANTIATE_TYPE(double)
} //namespace Opm