25 #include <opm/simulators/linalg/bda/opencl/opencl.hpp>
26 #include <opm/simulators/linalg/bda/opencl/BILU0.hpp>
27 #include <opm/simulators/linalg/bda/opencl/Preconditioner.hpp>
38 template <
unsigned int block_size>
47 using Base::verbosity;
54 std::once_flag initialize;
56 std::vector<int> colPointers;
57 std::vector<int> rowIndices;
58 std::vector<int> diagIndex;
59 std::vector<int> csrToCscOffsetMap;
60 std::vector<double> invLvals;
61 std::vector<double> invUvals;
63 cl::Buffer d_colPointers;
64 cl::Buffer d_rowIndices;
65 cl::Buffer d_csrToCscOffsetMap;
66 cl::Buffer d_diagIndex;
68 cl::Buffer d_invDiagVals;
69 cl::Buffer d_invLvals;
70 cl::Buffer d_invUvals;
73 ILUReorder opencl_ilu_reorder;
74 std::unique_ptr<BILU0<block_size> > bilu0;
80 std::vector<int> subsystemPointers;
85 std::vector<int> nzIndices;
88 std::vector<int> knownRhsIndices;
90 std::vector<int> unknownRhsIndices;
95 cl::Buffer subsystemPointers;
97 cl::Buffer knownRhsIndices;
98 cl::Buffer unknownRhsIndices;
99 } subsystemStructureGPU;
101 subsystemStructure lower, upper;
102 subsystemStructureGPU d_lower, d_upper;
106 void buildLowerSubsystemsStructures();
110 void buildUpperSubsystemsStructures();
113 BISAI(ILUReorder opencl_ilu_reorder,
int verbosity);
116 void setOpencl(std::shared_ptr<cl::Context>& context, std::shared_ptr<cl::CommandQueue>& queue)
override;
125 void apply(
const cl::Buffer& y, cl::Buffer& x)
override;
127 int* getToOrder()
override
129 return bilu0->getToOrder();
132 int* getFromOrder()
override
134 return bilu0->getFromOrder();
139 return bilu0->getRMat();
146 std::vector<int> buildCsrToCscOffsetMap(std::vector<int> colPointers, std::vector<int> rowIndices);
This class implements a Blocked version of the Incomplete Sparse Approximate Inverse (ISAI) precondit...
Definition: BISAI.hpp:40
This struct resembles a blocked csr matrix, like Dune::BCRSMatrix.
Definition: BlockedMatrix.hpp:37
Definition: Preconditioner.hpp:36
This file contains a set of helper functions used by VFPProd / VFPInj.
Definition: BlackoilPhases.hpp:27