My Project
|
This class implements a opencl-based ilu0-bicgstab solver on GPU. More...
#include <openclSolverBackend.hpp>
Public Member Functions | |
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. | |
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. | |
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. | |
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. | |
![]() | |
GpuSolver (int linear_solver_verbosity, int max_it, Scalar tolerance_) | |
Construct a GpuSolver. | |
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. | |
Public Attributes | |
std::shared_ptr< cl::Context > | context {} |
std::shared_ptr< cl::CommandQueue > | queue {} |
Additional Inherited Members | |
![]() | |
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 |
This class implements a opencl-based ilu0-bicgstab solver on GPU.
Opm::Accelerator::openclSolverBackend< Scalar, block_size >::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.
[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 |
|
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
[in,out] | x | resulting x vector, caller must guarantee that x points to a valid array |
Implements Opm::Accelerator::GpuSolver< Scalar, block_size >.
void Opm::Accelerator::openclSolverBackend< Scalar, block_size >::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.
[in] | context | the opencl context to be used |
[in] | queue | the opencl queue to be used |
|
overridevirtual |
Solve linear system, A*x = b, matrix A must be in blocked-CSR format.
[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 |
Implements Opm::Accelerator::GpuSolver< Scalar, block_size >.