20 #ifndef OPM_OPENCLBISAI_HPP 21 #define OPM_OPENCLBISAI_HPP 25 #include <opm/simulators/linalg/gpubridge/opencl/opencl.hpp> 26 #include <opm/simulators/linalg/gpubridge/opencl/openclBILU0.hpp> 27 #include <opm/simulators/linalg/gpubridge/opencl/openclPreconditioner.hpp> 31 template<
class Scalar>
class BlockedMatrix;
35 template<
class Scalar,
unsigned int block_size>
44 using Base::verbosity;
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();
110 openclBISAI(
bool opencl_ilu_parallel,
int verbosity);
113 void setOpencl(std::shared_ptr<cl::Context>& context,
114 std::shared_ptr<cl::CommandQueue>& queue)
override;
127 void apply(
const cl::Buffer& y,
135 std::vector<int> buildCsrToCscOffsetMap(std::vector<int> colPointers, std::vector<int> rowIndices);
Definition: openclPreconditioner.hpp:31
Definition: amgclSolverBackend.cpp:49
This class serves to eliminate the need to include the WellContributions into the matrix (with –matr...
Definition: GpuBridge.hpp:30
This struct resembles a blocked csr matrix, like Dune::BCRSMatrix.
Definition: BlockedMatrix.hpp:28
This class implements a Blocked version of the Incomplete Sparse Approximate Inverse (ISAI) precondit...
Definition: openclBISAI.hpp:36