19 #ifndef OPM_GPUJAC_HPP 20 #define OPM_GPUJAC_HPP 22 #include <dune/istl/preconditioner.hh> 23 #include <opm/simulators/linalg/PreconditionerWithUpdate.hpp> 24 #include <opm/simulators/linalg/gpuistl/GpuSparseMatrixWrapper.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> 45 template <
class M,
class X,
class Y,
int l = 1>
68 virtual void pre(X& x, Y& b)
override;
71 virtual void apply(X& v,
const Y& d)
override;
75 virtual void post(X& x)
override;
78 virtual Dune::SolverCategory::Category
category()
const override;
81 virtual void update()
override;
96 virtual bool hasPerfectUpdate()
const override {
107 GpuVector<field_type> m_diagInvFlattened;
109 void invertDiagonalAndFlatten();
111 template<
int blocksize>
112 void dispatchInvertDiagonalAndFlatten();
virtual void post(X &x) override
Post processing.
Definition: GpuJac.cpp:71
virtual Dune::SolverCategory::Category category() const override
Category of the preconditioner (see SolverCategory::Category)
Definition: GpuJac.cpp:77
typename X::field_type field_type
The field type of the preconditioner.
Definition: GpuJac.hpp:56
static constexpr bool shouldCallPost()
Definition: GpuJac.hpp:91
Interface class adding the update() method to the preconditioner interface.
Definition: PreconditionerWithUpdate.hpp:33
typename std::remove_const< M >::type matrix_type
The matrix type the preconditioner is for.
Definition: GpuJac.hpp:50
static constexpr bool shouldCallPre()
Definition: GpuJac.hpp:85
virtual void apply(X &v, const Y &d) override
Apply the preconditoner.
Definition: GpuJac.cpp:58
GpuJac(const M &A, field_type w)
Constructor.
Definition: GpuJac.cpp:40
A small, fixed‑dimension MiniVector class backed by std::array that can be used in both host and CUD...
Definition: AmgxInterface.hpp:37
Jacobi preconditioner on the GPU.
Definition: GpuJac.hpp:46
virtual void pre(X &x, Y &b) override
Prepare the preconditioner.
Definition: GpuJac.cpp:52
Y range_type
The range type of the preconditioner.
Definition: GpuJac.hpp:54
virtual void update() override
Updates the matrix data.
Definition: GpuJac.cpp:84
X domain_type
The domain type of the preconditioner.
Definition: GpuJac.hpp:52