ILU0Kernels.hpp
Go to the documentation of this file.
1/*
2 Copyright 2024 SINTEF AS
3
4 This file is part of the Open Porous Media project (OPM).
5
6 OPM is free software: you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation, either version 3 of the License, or
9 (at your option) any later version.
10
11 OPM is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
15
16 You should have received a copy of the GNU General Public License
17 along with OPM. If not, see <http://www.gnu.org/licenses/>.
18*/
19#ifndef OPM_ILU0_KERNELS_HPP
20#define OPM_ILU0_KERNELS_HPP
21#include <cstddef>
22#include <vector>
25{
26
41template <class T, int blocksize>
42void solveUpperLevelSet(T* reorderedMat,
43 int* rowIndices,
44 int* colIndices,
45 int* indexConversion,
46 int startIdx,
47 int rowsInLevelSet,
48 T* v,
49 int threadBlockSize,
50 cudaStream_t stream);
51
67template <class T, int blocksize>
68void solveLowerLevelSet(T* reorderedMat,
69 int* rowIndices,
70 int* colIndices,
71 int* indexConversion,
72 int startIdx,
73 int rowsInLevelSet,
74 const T* d,
75 T* v,
76 int threadBlockSize,
77 cudaStream_t stream);
78
95template <int blocksize, class LinearSolverScalar, class MatrixScalar, class DiagonalScalar>
96void solveUpperLevelSetSplit(MatrixScalar* reorderedMat,
97 int* rowIndices,
98 int* colIndices,
99 int* indexConversion,
100 int startIdx,
101 int rowsInLevelSet,
102 const DiagonalScalar* dInv,
103 LinearSolverScalar* v,
104 int threadBlockSize,
105 cudaStream_t stream);
106
124template <int blocksize, class LinearSolverScalar, class MatrixScalar>
125void solveLowerLevelSetSplit(MatrixScalar* reorderedLowerMat,
126 int* rowIndices,
127 int* colIndices,
128 int* indexConversion,
129 int startIdx,
130 int rowsInLevelSet,
131 const LinearSolverScalar* d,
132 LinearSolverScalar* v,
133 int threadBlockSize,
134 cudaStream_t stream);
135
152template <class T, int blocksize>
153void LUFactorization(T* reorderedMat,
154 int* rowIndices,
155 int* columnIndices,
156 int* naturalToReordered,
157 int* reorderedToNatual,
158 size_t rowsInLevelSet,
159 int startIdx,
160 int threadBlockSize);
161
184template <int blocksize, class InputScalar, class OutputScalar, MatrixStorageMPScheme mixedPrecisionScheme>
185void LUFactorizationSplit(InputScalar* srcReorderedLowerMat,
186 int* lowerRowIndices,
187 int* lowerColIndices,
188 InputScalar* srcReorderedUpperMat,
189 int* upperRowIndices,
190 int* upperColIndices,
191 InputScalar* srcDiagonal,
192 OutputScalar* dstReorderedLowerMat,
193 OutputScalar* dstReorderedUpperMat,
194 OutputScalar* dstDiagonal,
195 int* reorderedToNatural,
196 int* naturalToReordered,
197 int startIdx,
198 int rowsInLevelSet,
199 int threadBlockSize);
200
201} // namespace Opm::gpuistl::detail::ILU0
202#endif
Definition: ILU0Kernels.hpp:25
void solveLowerLevelSet(T *reorderedMat, int *rowIndices, int *colIndices, int *indexConversion, int startIdx, int rowsInLevelSet, const T *d, T *v, int threadBlockSize, cudaStream_t stream)
Perform a lower solve on certain rows in a matrix that can safely be computed in parallel.
void LUFactorizationSplit(InputScalar *srcReorderedLowerMat, int *lowerRowIndices, int *lowerColIndices, InputScalar *srcReorderedUpperMat, int *upperRowIndices, int *upperColIndices, InputScalar *srcDiagonal, OutputScalar *dstReorderedLowerMat, OutputScalar *dstReorderedUpperMat, OutputScalar *dstDiagonal, int *reorderedToNatural, int *naturalToReordered, int startIdx, int rowsInLevelSet, int threadBlockSize)
Computes the ILU0 factorization in-place of a bcsr matrix stored in a split format (lower,...
void LUFactorization(T *reorderedMat, int *rowIndices, int *columnIndices, int *naturalToReordered, int *reorderedToNatual, size_t rowsInLevelSet, int startIdx, int threadBlockSize)
Computes the ILU Factorization of the input bcsr matrix, which is stored in a reordered way....
void solveUpperLevelSet(T *reorderedMat, int *rowIndices, int *colIndices, int *indexConversion, int startIdx, int rowsInLevelSet, T *v, int threadBlockSize, cudaStream_t stream)
Perform a upper solve on certain rows in a matrix that can safely be computed in parallel.
void solveLowerLevelSetSplit(MatrixScalar *reorderedLowerMat, int *rowIndices, int *colIndices, int *indexConversion, int startIdx, int rowsInLevelSet, const LinearSolverScalar *d, LinearSolverScalar *v, int threadBlockSize, cudaStream_t stream)
Perform an lower solve on certain rows in a matrix that can safely be computed in parallel.
void solveUpperLevelSetSplit(MatrixScalar *reorderedMat, int *rowIndices, int *colIndices, int *indexConversion, int startIdx, int rowsInLevelSet, const DiagonalScalar *dInv, LinearSolverScalar *v, int threadBlockSize, cudaStream_t stream)
Perform an upper solve on certain rows in a matrix that can safely be computed in parallel.