This class implements a opencl-based ilu0-bicgstab solver on GPU.
More...
#include <openclSolverBackend.hpp>
|
| openclSolverBackend (int linear_solver_verbosity, int maxit, double tolerance, unsigned int platformID, unsigned int deviceID, bool opencl_ilu_parallel, std::string linsolver) |
| Construct a openclSolver.
|
|
| openclSolverBackend (int linear_solver_verbosity, int maxit, double tolerance, bool opencl_ilu_parallel) |
| For the CPR coarse solver.
|
|
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.
|
|
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.
|
|
void | setOpencl (std::shared_ptr< cl::Context > &context, std::shared_ptr< cl::CommandQueue > &queue) |
| Set OpenCL objects This class either creates them based on platformID and deviceID or receives them through this function.
|
|
| BdaSolver (int linear_solver_verbosity, int max_it, double tolerance_) |
| Construct a BdaSolver.
|
|
| 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.
|
|
|
std::shared_ptr< cl::Context > | context |
|
std::shared_ptr< cl::CommandQueue > | queue |
|
|
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 |
|
template<unsigned int block_size>
class Opm::Accelerator::openclSolverBackend< block_size >
This class implements a opencl-based ilu0-bicgstab solver on GPU.
◆ openclSolverBackend()
template<unsigned int block_size>
Opm::Accelerator::openclSolverBackend< block_size >::openclSolverBackend |
( |
int |
linear_solver_verbosity, |
|
|
int |
maxit, |
|
|
double |
tolerance, |
|
|
unsigned int |
platformID, |
|
|
unsigned int |
deviceID, |
|
|
bool |
opencl_ilu_parallel, |
|
|
std::string |
linsolver |
|
) |
| |
Construct a openclSolver.
- Parameters
-
[in] | linear_solver_verbosity | verbosity of openclSolver |
[in] | maxit | maximum number of iterations for openclSolver |
[in] | tolerance | required relative tolerance for openclSolver |
[in] | platformID | the OpenCL platform to be used |
[in] | deviceID | the device to be used |
[in] | opencl_ilu_parallel | whether to parallelize the ILU decomposition and application in OpenCL with level_scheduling |
[in] | linsolver | indicating the preconditioner, equal to the –linear-solver cmdline argument only ilu0, cpr_quasiimpes and isai are supported |
◆ get_result()
template<unsigned int block_size>
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] | x | resulting x vector, caller must guarantee that x points to a valid array |
Implements Opm::Accelerator::BdaSolver< block_size >.
◆ setOpencl()
template<unsigned int block_size>
Set OpenCL objects This class either creates them based on platformID and deviceID or receives them through this function.
- Parameters
-
[in] | context | the opencl context to be used |
[in] | queue | the opencl queue to be used |
◆ solve_system()
template<unsigned int block_size>
Solve linear system, A*x = b, matrix A must be in blocked-CSR format.
- Parameters
-
[in] | matrix | matrix A |
[in] | b | input vector, contains N values |
[in] | jacMatrix | matrix for preconditioner |
[in] | wellContribs | WellContributions, to apply them separately, instead of adding them to matrix A |
[in,out] | res | summary of solver result |
- Returns
- status code
Implements Opm::Accelerator::BdaSolver< block_size >.
The documentation for this class was generated from the following files: