19#ifndef OPM_GPUSEQILU0_HPP
20#define OPM_GPUSEQILU0_HPP
22#include <dune/istl/preconditioner.hh>
23#include <opm/simulators/linalg/PreconditionerWithUpdate.hpp>
24#include <opm/simulators/linalg/gpuistl/GpuSparseMatrix.hpp>
25#include <opm/simulators/linalg/gpuistl/detail/CuMatrixDescription.hpp>
26#include <opm/simulators/linalg/gpuistl/detail/CuSparseHandle.hpp>
27#include <opm/simulators/linalg/gpuistl/detail/CuSparseResource.hpp>
48template <
class M,
class X,
class Y,
int l = 1>
71 virtual void pre(X& x, Y&
b)
override;
74 virtual void apply(X&
v,
const Y&
d)
override;
78 virtual void post(X& x)
override;
81 virtual Dune::SolverCategory::Category
category()
const override;
84 virtual void update()
override;
99 virtual bool hasPerfectUpdate()
const override {
106 const M& m_underlyingMatrix;
113 GpuSparseMatrix<field_type> m_LU;
120 detail::CuSparseResource<bsrsv2Info_t> m_infoL;
121 detail::CuSparseResource<bsrsv2Info_t> m_infoU;
122 detail::CuSparseResource<bsrilu02Info_t> m_infoM;
124 std::unique_ptr<GpuVector<field_type>> m_buffer;
125 detail::CuSparseHandle& m_cuSparseHandle;
127 bool m_analysisDone =
false;
129 void analyzeMatrix();
130 size_t findBufferSize();
134 void updateILUConfiguration();
Interface class adding the update() method to the preconditioner interface.
Definition PreconditionerWithUpdate.hpp:32
Sequential ILU0 preconditioner on the GPU through the CuSparse library.
Definition GpuSeqILU0.hpp:50
typename std::remove_const< M >::type matrix_type
The matrix type the preconditioner is for.
Definition GpuSeqILU0.hpp:53
virtual void update() override
Updates the matrix data.
Definition GpuSeqILU0.cpp:149
Y range_type
The range type of the preconditioner.
Definition GpuSeqILU0.hpp:57
virtual void pre(X &x, Y &b) override
Prepare the preconditioner.
Definition GpuSeqILU0.cpp:73
typename X::field_type field_type
The field type of the preconditioner.
Definition GpuSeqILU0.hpp:59
virtual void post(X &x) override
Post processing.
Definition GpuSeqILU0.cpp:136
virtual void apply(X &v, const Y &d) override
Apply the preconditoner.
Definition GpuSeqILU0.cpp:79
X domain_type
The domain type of the preconditioner.
Definition GpuSeqILU0.hpp:55
static constexpr bool shouldCallPost()
Definition GpuSeqILU0.hpp:94
static constexpr bool shouldCallPre()
Definition GpuSeqILU0.hpp:88
virtual Dune::SolverCategory::Category category() const override
Category of the preconditioner (see SolverCategory::Category)
Definition GpuSeqILU0.cpp:142
std::shared_ptr< CuSparseResource< cusparseMatDescr_t > > GpuSparseMatrixDescriptionPtr
Pointer to GpuSparseMatrixDescription holder.
Definition CuMatrixDescription.hpp:35
constexpr auto getPropValue()
get the value data member of a property
Definition propertysystem.hh:242