20#ifndef OPM_CUSPARSESOLVER_BACKEND_HEADER_INCLUDED
21#define OPM_CUSPARSESOLVER_BACKEND_HEADER_INCLUDED
25#include "cusparse_v2.h"
27#include <opm/simulators/linalg/gpubridge/GpuResult.hpp>
28#include <opm/simulators/linalg/gpubridge/GpuSolver.hpp>
29#include <opm/simulators/linalg/gpubridge/WellContributions.hpp>
31namespace Opm::Accelerator {
34template<
class Scalar,
unsigned int block_size>
43 using Base::verbosity;
46 using Base::tolerance;
47 using Base::initialized;
57 Scalar *d_bVals, *d_mVals;
58 int *d_bCols, *d_mCols;
59 int *d_bRows, *d_mRows;
60 Scalar *d_x, *d_b, *d_r, *d_rw, *d_p;
61 Scalar *d_pw, *d_s, *d_t, *d_v;
63 Scalar *vals_contiguous;
65 bool analysis_done =
false;
67 bool useJacMatrix =
false;
107 bool analyse_matrix();
111 bool create_preconditioner();
125 Scalar tolerance,
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 cusparse-based ilu0-bicgstab solver on GPU.
Definition cusparseSolverBackend.hpp:36
cusparseSolverBackend(int linear_solver_verbosity, int maxit, Scalar tolerance, unsigned int deviceID)
Construct a cusparseSolver.
~cusparseSolverBackend()
Destroy a cusparseSolver, and free memory.
SolverStatus solve_system(std::shared_ptr< BlockedMatrix< Scalar > > matrix, Scalar *b, std::shared_ptr< BlockedMatrix< Scalar > > jacMatrix, WellContributions< Scalar > &wellContribs, GpuResult &res) override
Solve linear system, A*x = b, matrix A must be in blocked-CSR format.
void get_result(Scalar *x) override
Get resulting vector x after linear solve, also includes post processing if necessary.
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