20 #ifndef OPM_OPENCLBILU0_HPP 21 #define OPM_OPENCLBILU0_HPP 23 #include <opm/simulators/linalg/gpubridge/BlockedMatrix.hpp> 25 #include <opm/simulators/linalg/gpubridge/opencl/opencl.hpp> 26 #include <opm/simulators/linalg/gpubridge/opencl/openclPreconditioner.hpp> 27 #include <opm/simulators/linalg/gpubridge/opencl/ChowPatelIlu.hpp> 37 template<
class Scalar,
unsigned int block_size>
46 using Base::verbosity;
53 std::unique_ptr<BlockedMatrix<Scalar>> LUmat{};
55 std::unique_ptr<BlockedMatrix<Scalar>> Lmat{}, Umat{};
57 std::vector<Scalar> invDiagVals;
58 std::vector<int> diagIndex;
59 std::vector<int> rowsPerColor;
60 std::vector<int> rowsPerColorPrefix;
61 std::vector<int> toOrder, fromOrder;
63 std::once_flag pattern_uploaded;
65 bool opencl_ilu_parallel;
68 cl::Buffer invDiagVals;
70 cl::Buffer rowsPerColor;
71 cl::Buffer rowIndices;
75 cl::Buffer Lvals, Lcols, Lrows;
76 cl::Buffer Uvals, Ucols, Urows;
78 cl::Buffer LUvals, LUcols, LUrows;
85 ChowPatelIlu<block_size> chowPatelIlu;
90 openclBILU0(
bool opencl_ilu_parallel,
int verbosity);
105 void apply(
const cl::Buffer& y,
109 std::tuple<std::vector<int>, std::vector<int>, std::vector<int>>
110 get_preconditioner_structure()
112 return {{LUmat->rowPointers, LUmat->rowPointers + (Nb + 1)},
113 {LUmat->colIndices, LUmat->colIndices + nnzb}, diagIndex};
116 std::pair<cl::Buffer, cl::Buffer> get_preconditioner_data()
119 return std::make_pair(s.Lvals, s.invDiagVals);
121 return std::make_pair(s.LUvals, s.invDiagVals);
Definition: openclPreconditioner.hpp:31
Definition: amgclSolverBackend.cpp:49
This class implements a Blocked ILU0 preconditioner The decomposition is done on GPU, using exact decomposition, or ChowPatel decomposition The preconditioner is applied via two exact triangular solves.
Definition: openclBILU0.hpp:38
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