Opm::Accelerator::cusparseSolverBackend< block_size > Class Template Reference

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

#include <cusparseSolverBackend.hpp>

Inheritance diagram for Opm::Accelerator::cusparseSolverBackend< block_size >:
Inheritance graph

Public Member Functions

 cusparseSolverBackend (int linear_solver_verbosity, int maxit, double tolerance, unsigned int deviceID)
 
 ~cusparseSolverBackend ()
 Destroy a cusparseSolver, and free memory. More...
 
SolverStatus solve_system (std::shared_ptr< BlockedMatrix > matrix, double *b, std::shared_ptr< BlockedMatrix > jacMatrix, WellContributions &wellContribs, BdaResult &res) override
 
void get_result (double *x) override
 

Protected Attributes

unsigned int platformID = 0
 

Detailed Description

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

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

Constructor & Destructor Documentation

◆ cusparseSolverBackend()

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

Construct a cusparseSolver

Parameters
[in]linear_solver_verbosityverbosity of cusparseSolver
[in]maxitmaximum number of iterations for cusparseSolver
[in]tolerancerequired relative tolerance for cusparseSolver
[in]deviceIDthe device to be used

◆ ~cusparseSolverBackend()

template<unsigned int block_size>
Opm::Accelerator::cusparseSolverBackend< block_size >::~cusparseSolverBackend ( )

Destroy a cusparseSolver, and free memory.

Member Function Documentation

◆ get_result()

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

Get resulting vector x after linear solve, also includes post processing 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::cusparseSolverBackend< 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]wellContribscontains all WellContributions, 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 >.

Member Data Documentation

◆ platformID

template<unsigned int block_size>
unsigned int Opm::Accelerator::BdaSolver< block_size >::platformID = 0
protectedinherited

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