This class implements a opencl-based ilu0-bicgstab solver on GPU.
More...
#include <openclSolverBackend.hpp>
|
| | openclSolverBackend (int linear_solver_verbosity, int maxit, Scalar tolerance, unsigned int platformID, unsigned int deviceID, bool opencl_ilu_parallel, std::string linsolver) |
| | Construct a openclSolver. More...
|
| |
|
| openclSolverBackend (int linear_solver_verbosity, int maxit, Scalar tolerance, bool opencl_ilu_parallel) |
| | For the CPR coarse solver.
|
| |
| 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. More...
|
| |
| void | get_result (Scalar *x) override |
| | Solve scalar linear system, for example a coarse system of an AMG preconditioner Data is already on the GPU. More...
|
| |
| 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. More...
|
| |
| | GpuSolver (int linear_solver_verbosity, int max_it, Scalar tolerance_) |
| | Construct a GpuSolver. More...
|
| |
|
| GpuSolver (int linear_solver_verbosity, int max_it, Scalar tolerance_, unsigned int deviceID_) |
| |
|
| GpuSolver (int linear_solver_verbosity, int max_it, double tolerance_, unsigned int platformID_, unsigned int deviceID_) |
| |
|
virtual | ~GpuSolver ()=default |
| | 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 |
| |
|
Scalar | tolerance = 1e-2 |
| |
|
int | N |
| |
|
int | Nb |
| |
|
int | nnz |
| |
|
int | nnzb |
| |
|
unsigned int | platformID = 0 |
| |
|
unsigned int | deviceID = 0 |
| |
|
bool | initialized = false |
| |
template<class Scalar, unsigned int block_size>
class Opm::Accelerator::openclSolverBackend< Scalar, block_size >
This class implements a opencl-based ilu0-bicgstab solver on GPU.
◆ openclSolverBackend()
template<class Scalar , unsigned int block_size>
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<class Scalar , 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::GpuSolver< Scalar, block_size >.
◆ setOpencl()
template<class Scalar , 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<class Scalar , 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::GpuSolver< Scalar, block_size >.
The documentation for this class was generated from the following files:
- opm/simulators/linalg/gpubridge/opencl/openclSolverBackend.hpp
- opm/simulators/linalg/gpubridge/opencl/openclSolverBackend.cpp