Opm::Accelerator::rocsparseSolverBackend< Scalar, 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< Scalar, block_size >:
Inheritance graph

Public Member Functions

 rocsparseSolverBackend (int linear_solver_verbosity, int maxit, Scalar tolerance, unsigned int platformID, unsigned int deviceID, std::string linsolver)
 
 rocsparseSolverBackend (int linear_solver_verbosity, int maxit, Scalar tolerance, bool opencl_ilu_reorder)
 For the CPR coarse solver. More...
 
 ~rocsparseSolverBackend ()
 Destroy a openclSolver, and free memory. More...
 
SolverStatus solve_system (std::shared_ptr< BlockedMatrix< Scalar > > matrix, Scalar *b, std::shared_ptr< BlockedMatrix< Scalar > > jacMatrix, WellContributions< Scalar > &wellContribs, BdaResult &res) override
 
void get_result (Scalar *x) override
 

Detailed Description

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

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

Constructor & Destructor Documentation

◆ rocsparseSolverBackend() [1/2]

template<class Scalar , unsigned int block_size>
Opm::Accelerator::rocsparseSolverBackend< Scalar, block_size >::rocsparseSolverBackend ( int  linear_solver_verbosity,
int  maxit,
Scalar  tolerance,
unsigned int  platformID,
unsigned int  deviceID,
std::string  linsolver 
)

Construct a rocsparseSolver

Parameters
[in]linear_solver_verbosityverbosity of rocsparseSolver
[in]maxitmaximum number of iterations for rocsparseSolver
[in]tolerancerequired relative tolerance for rocsparseSolver
[in]platformIDthe OpenCL platform to be used
[in]deviceIDthe device to be used
[in]linsolverindicating the preconditioner, equal to the –linear-solver cmdline argument

◆ rocsparseSolverBackend() [2/2]

template<class Scalar , unsigned int block_size>
Opm::Accelerator::rocsparseSolverBackend< Scalar, block_size >::rocsparseSolverBackend ( int  linear_solver_verbosity,
int  maxit,
Scalar  tolerance,
bool  opencl_ilu_reorder 
)

For the CPR coarse solver.

◆ ~rocsparseSolverBackend()

template<class Scalar , unsigned int block_size>
Opm::Accelerator::rocsparseSolverBackend< Scalar, block_size >::~rocsparseSolverBackend ( )

Destroy a openclSolver, and free memory.

Member Function Documentation

◆ get_result()

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

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< Scalar, block_size >.

◆ solve_system()

template<class Scalar , unsigned int block_size>
SolverStatus Opm::Accelerator::rocsparseSolverBackend< Scalar, block_size >::solve_system ( std::shared_ptr< BlockedMatrix< Scalar > >  matrix,
Scalar *  b,
std::shared_ptr< BlockedMatrix< Scalar > >  jacMatrix,
WellContributions< Scalar > &  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< Scalar, block_size >.


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