20#ifndef OPM_ROCSPARSESOLVER_BACKEND_HEADER_INCLUDED
21#define OPM_ROCSPARSESOLVER_BACKEND_HEADER_INCLUDED
25#include <opm/simulators/linalg/gpubridge/GpuResult.hpp>
26#include <opm/simulators/linalg/gpubridge/GpuSolver.hpp>
27#include <opm/simulators/linalg/gpubridge/WellContributions.hpp>
29#include <opm/simulators/linalg/gpubridge/rocm/rocsparsePreconditioner.hpp>
31#include <rocblas/rocblas.h>
32#include <rocsparse/rocsparse.h>
34#include <hip/hip_version.h>
36namespace Opm::Accelerator {
39template<
class Scalar,
unsigned int block_size>
48 using Base::verbosity;
49 using Base::platformID;
52 using Base::tolerance;
53 using Base::initialized;
58 bool useJacMatrix =
false;
60 bool analysis_done =
false;
61 std::shared_ptr<BlockedMatrix<Scalar>> mat{};
68#if HIP_VERSION >= 50400000
75 Scalar *d_x, *d_b, *d_r, *d_rw, *d_p;
76 Scalar *d_pw, *d_s, *d_t, *d_v;
80 std::unique_ptr<rocsparsePreconditioner<Scalar, block_size> > prec;
95 void copy_system_to_gpu(Scalar*
b);
99 void update_system_on_gpu(Scalar*
b);
103 bool analyze_matrix();
107 bool create_preconditioner();
125 unsigned int platformID,
126 unsigned int deviceID,
This struct resembles a blocked csr matrix, like Dune::BCRSMatrix.
Definition BlockedMatrix.hpp:29
This class is based on InverseOperatorResult struct from dune/istl/solver.hh It is needed to prevent ...
Definition GpuResult.hpp:31
This class serves to simplify choosing between different backend solvers, such as cusparseSolver and ...
Definition GpuSolver.hpp:46
This class implements a rocsparse-based ilu0-bicgstab solver on GPU.
Definition rocsparseSolverBackend.hpp:41
~rocsparseSolverBackend()
Destroy a openclSolver, and free memory.
Definition rocsparseSolverBackend.cpp:113
void get_result(Scalar *x) override
Get result after linear solve, and peform postprocessing if necessary.
Definition rocsparseSolverBackend.cpp:660
rocsparseSolverBackend(int linear_solver_verbosity, int maxit, Scalar tolerance, bool opencl_ilu_reorder)
For the CPR coarse solver.
This class serves to eliminate the need to include the WellContributions into the matrix (with –matri...
Definition WellContributions.hpp:51
constexpr auto getPropValue()
get the value data member of a property
Definition propertysystem.hh:242