20#ifndef OPM_OPENCLBISAI_HPP
21#define OPM_OPENCLBISAI_HPP
31template<
class Scalar>
class BlockedMatrix;
35template<
class Scalar,
unsigned int block_size>
51 std::once_flag initialize;
53 std::vector<int> colPointers;
54 std::vector<int> rowIndices;
55 std::vector<int> diagIndex;
56 std::vector<int> csrToCscOffsetMap;
57 std::vector<Scalar> invLvals;
58 std::vector<Scalar> invUvals;
60 cl::Buffer d_colPointers;
61 cl::Buffer d_rowIndices;
62 cl::Buffer d_csrToCscOffsetMap;
63 cl::Buffer d_diagIndex;
65 cl::Buffer d_invDiagVals;
66 cl::Buffer d_invLvals;
67 cl::Buffer d_invUvals;
70 bool opencl_ilu_parallel;
71 std::unique_ptr<openclBILU0<Scalar,block_size>> bilu0;
74 struct subsystemStructure {
77 std::vector<int> subsystemPointers;
82 std::vector<int> nzIndices;
85 std::vector<int> knownRhsIndices;
87 std::vector<int> unknownRhsIndices;
91 struct subsystemStructureGPU {
92 cl::Buffer subsystemPointers;
94 cl::Buffer knownRhsIndices;
95 cl::Buffer unknownRhsIndices;
98 subsystemStructure lower, upper;
99 subsystemStructureGPU d_lower, d_upper;
103 void buildLowerSubsystemsStructures();
107 void buildUpperSubsystemsStructures();
114 std::shared_ptr<cl::CommandQueue>& queue)
override;
127 void apply(
const cl::Buffer& y, cl::Buffer& x)
override;
128 void apply(Scalar&, Scalar&)
override {}
Definition: BlockedMatrix.hpp:29
int nnz
Definition: Preconditioner.hpp:45
int Nb
Definition: Preconditioner.hpp:44
int verbosity
Definition: Preconditioner.hpp:47
int nnzb
Definition: Preconditioner.hpp:46
int N
Definition: Preconditioner.hpp:43
Definition: openclBISAI.hpp:37
bool create_preconditioner(BlockedMatrix< Scalar > *mat) override
bool analyze_matrix(BlockedMatrix< Scalar > *mat, BlockedMatrix< Scalar > *jacMat) override
void apply(const cl::Buffer &y, cl::Buffer &x) override
void apply(Scalar &, Scalar &) override
Definition: openclBISAI.hpp:128
bool create_preconditioner(BlockedMatrix< Scalar > *mat, BlockedMatrix< Scalar > *jacMat) override
openclBISAI(bool opencl_ilu_parallel, int verbosity)
void setOpencl(std::shared_ptr< cl::Context > &context, std::shared_ptr< cl::CommandQueue > &queue) override
bool analyze_matrix(BlockedMatrix< Scalar > *mat) override
Definition: openclPreconditioner.hpp:32
cl_int err
Definition: openclPreconditioner.hpp:38
std::shared_ptr< cl::Context > context
Definition: openclPreconditioner.hpp:35
std::vector< cl::Event > events
Definition: openclPreconditioner.hpp:37
std::shared_ptr< cl::CommandQueue > queue
Definition: openclPreconditioner.hpp:36
Definition: amgclSolverBackend.hpp:44
std::vector< int > buildCsrToCscOffsetMap(std::vector< int > colPointers, std::vector< int > rowIndices)