Added block_size template to BdaSolvers and BILU0

This commit is contained in:
T.D. (Tongdong) Qiu
2020-06-24 20:09:14 +02:00
parent 2a48f5f63f
commit 98ddf47b44
11 changed files with 232 additions and 91 deletions

View File

@@ -31,15 +31,29 @@
#include <opm/simulators/linalg/bda/WellContributions.hpp>
#include <opm/simulators/linalg/bda/BILU0.hpp>
typedef bda::BILU0 Preconditioner;
namespace bda
{
/// This class implements a opencl-based ilu0-bicgstab solver on GPU
class openclSolverBackend : public BdaSolver
template <unsigned int block_size>
class openclSolverBackend : public BdaSolver<block_size>
{
typedef BdaSolver<block_size> Base;
typedef BILU0<block_size> Preconditioner;
using Base::N;
using Base::Nb;
using Base::nnz;
using Base::nnzb;
using Base::verbosity;
using Base::maxit;
using Base::tolerance;
using Base::second;
using Base::initialized;
typedef BdaSolverStatus::Status Status;
private:
double *rb; // reordered b vector, the matrix is reordered, so b must also be
@@ -182,7 +196,7 @@ public:
/// \param[in] wellContribs WellContributions, to apply them separately, instead of adding them to matrix A
/// \param[inout] res summary of solver result
/// \return status code
BdaSolverStatus solve_system(int N, int nnz, int dim, double *vals, int *rows, int *cols, double *b, WellContributions& wellContribs, BdaResult &res) override;
Status solve_system(int N, int nnz, int dim, double *vals, int *rows, int *cols, double *b, WellContributions& wellContribs, BdaResult &res) override;
/// Get result after linear solve, and peform postprocessing if necessary
/// \param[inout] x resulting x vector, caller must guarantee that x points to a valid array