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, ILUReorder opencl_ilu_reorder) |
| Construct a openclSolver. More...
|
|
| ~openclSolverBackend () |
| Destroy a openclSolver, and free memory.
|
|
SolverStatus | solve_system (int N, int nnz, int dim, double *vals, int *rows, int *cols, double *b, WellContributions &wellContribs, BdaResult &res) override |
| Solve linear system, A*x = b, matrix A must be in blocked-CSR format. More...
|
|
void | get_result (double *x) override |
| Get result after linear solve, and peform postprocessing if necessary. More...
|
|
| BdaSolver (int linear_solver_verbosity, int max_it, double tolerance_, unsigned int deviceID_) |
| Construct a BdaSolver, can be cusparseSolver, openclSolver, fpgaSolver. More...
|
|
| BdaSolver (int linear_solver_verbosity, int max_it, double tolerance_, unsigned int platformID_, unsigned int deviceID_) |
|
| BdaSolver (std::string fpga_bitstream, int linear_solver_verbosity, int max_it, double tolerance_) |
|
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 |
|
std::string | bitstream = "" |
|
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 bda::openclSolverBackend< block_size >
This class implements a opencl-based ilu0-bicgstab solver on GPU.
◆ openclSolverBackend()
template<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_reorder | select either level_scheduling or graph_coloring, see BILU0.hpp for explanation |
◆ get_result()
template<unsigned int block_size>
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 bda::BdaSolver< block_size >.
◆ solve_system()
template<unsigned int block_size>
Solve linear system, A*x = b, matrix A must be in blocked-CSR format.
- Parameters
-
[in] | N | number of rows, divide by dim to get number of blockrows |
[in] | nnz | number of nonzeroes, divide by dim*dim to get number of blocks |
[in] | nnz_prec | number of nonzeroes of matrix for ILU0, divide by dim*dim to get number of blocks |
[in] | dim | size of block |
[in] | vals | array of nonzeroes, each block is stored row-wise and contiguous, contains nnz values |
[in] | rows | array of rowPointers, contains N/dim+1 values |
[in] | cols | array of columnIndices, contains nnz values |
[in] | vals_prec | array of nonzeroes for preconditioner |
[in] | rows_prec | array of rowPointers for preconditioner |
[in] | cols_prec | array of columnIndices for preconditioner |
[in] | b | input vector, contains N values |
[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 bda::BdaSolver< block_size >.
The documentation for this class was generated from the following files: