My Project
Opm::Accelerator::rocsparseSolverBackend< block_size > Class Template Reference

This class implements a rocsparse-based ilu0-bicgstab solver on GPU. More...

#include <rocsparseSolverBackend.hpp>

Inheritance diagram for Opm::Accelerator::rocsparseSolverBackend< block_size >:
Opm::Accelerator::BdaSolver< block_size >

Public Member Functions

 rocsparseSolverBackend (int linear_solver_verbosity, int maxit, double tolerance, unsigned int platformID, unsigned int deviceID)
 Construct a openclSolver. More...
 
 ~rocsparseSolverBackend ()
 For the CPR coarse solver. More...
 
SolverStatus solve_system (std::shared_ptr< BlockedMatrix > matrix, double *b, std::shared_ptr< BlockedMatrix > jacMatrix, WellContributions &wellContribs, BdaResult &res) override
 Solve linear system, A*x = b, matrix A must be in blocked-CSR format. More...
 
void get_result (double *x) override
 Solve scalar linear system, for example a coarse system of an AMG preconditioner Data is already on the GPU. More...
 
- Public Member Functions inherited from Opm::Accelerator::BdaSolver< block_size >
 BdaSolver (int linear_solver_verbosity, int max_it, double tolerance_)
 Construct a BdaSolver. More...
 
 BdaSolver (int linear_solver_verbosity, int max_it, double tolerance_, unsigned int deviceID_)
 
 BdaSolver (int linear_solver_verbosity, int max_it, double tolerance_, unsigned int platformID_, unsigned int deviceID_)
 
virtual ~BdaSolver ()
 Define virtual destructor, so that the derivedclass destructor will be called.
 
virtual SolverStatus solve_system (std::shared_ptr< BlockedMatrix > matrix, double *b, std::shared_ptr< BlockedMatrix > jacMatrix, WellContributions &wellContribs, BdaResult &res)=0
 Define as pure virtual functions, so derivedclass must implement them. More...
 
virtual void get_result (double *x)=0
 

Additional Inherited Members

- Protected Attributes inherited from Opm::Accelerator::BdaSolver< block_size >
int verbosity = 0
 
int maxit = 200
 
double tolerance = 1e-2
 
int N
 
int Nb
 
int nnz
 
int nnzb
 
unsigned int platformID = 0
 
unsigned int deviceID = 0
 
bool initialized = false
 

Detailed Description

template<unsigned int block_size>
class Opm::Accelerator::rocsparseSolverBackend< block_size >

This class implements a rocsparse-based ilu0-bicgstab solver on GPU.

Constructor & Destructor Documentation

◆ rocsparseSolverBackend()

template<unsigned int block_size>
Opm::Accelerator::rocsparseSolverBackend< block_size >::rocsparseSolverBackend ( int  linear_solver_verbosity,
int  maxit,
double  tolerance,
unsigned int  platformID,
unsigned int  deviceID 
)

Construct a openclSolver.

Parameters
[in]linear_solver_verbosityverbosity of openclSolver
[in]maxitmaximum number of iterations for openclSolver
[in]tolerancerequired relative tolerance for openclSolver
[in]platformIDthe OpenCL platform to be used
[in]deviceIDthe device to be used

◆ ~rocsparseSolverBackend()

template<unsigned int block_size>
Opm::Accelerator::rocsparseSolverBackend< block_size >::~rocsparseSolverBackend

For the CPR coarse solver.

Destroy a openclSolver, and free memory

Member Function Documentation

◆ get_result()

template<unsigned int block_size>
void Opm::Accelerator::rocsparseSolverBackend< block_size >::get_result ( double *  x)
overridevirtual

Solve scalar linear system, for example a coarse system of an AMG preconditioner Data is already on the GPU.

Get result after linear solve, and peform postprocessing if necessary

Parameters
[in,out]xresulting x vector, caller must guarantee that x points to a valid array

Implements Opm::Accelerator::BdaSolver< block_size >.

◆ solve_system()

template<unsigned int block_size>
SolverStatus Opm::Accelerator::rocsparseSolverBackend< block_size >::solve_system ( std::shared_ptr< BlockedMatrix matrix,
double *  b,
std::shared_ptr< BlockedMatrix jacMatrix,
WellContributions wellContribs,
BdaResult res 
)
overridevirtual

Solve linear system, A*x = b, matrix A must be in blocked-CSR format.

Parameters
[in]matrixmatrix A
[in]binput vector, contains N values
[in]jacMatrixmatrix for preconditioner
[in]wellContribsWellContributions, to apply them separately, instead of adding them to matrix A
[in,out]ressummary of solver result
Returns
status code

Implements Opm::Accelerator::BdaSolver< block_size >.


The documentation for this class was generated from the following files: