DILUKernels.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_DILU_KERNELS_HPP
20#define OPM_DILU_KERNELS_HPP
21
22#include <cstddef>
23#include <cuda.h>
24#include <cuda_runtime.h>
26#include <vector>
27
29{
30
47template <class T, int blocksize>
48void solveLowerLevelSet(T* reorderedMat,
49 int* rowIndices,
50 int* colIndices,
51 int* indexConversion,
52 int startIdx,
53 int rowsInLevelSet,
54 const T* dInv,
55 const T* d,
56 T* v,
57 int threadBlockSize,
58 cudaStream_t stream);
59
76template <int blocksize, class LinearSolverScalar, class MatrixScalar, class DiagonalScalar>
77void solveLowerLevelSetSplit(MatrixScalar* reorderedUpperMat,
78 int* rowIndices,
79 int* colIndices,
80 int* indexConversion,
81 int startIdx,
82 int rowsInLevelSet,
83 const DiagonalScalar* dInv,
84 const LinearSolverScalar* d,
85 LinearSolverScalar* v,
86 int threadBlockSize,
87 cudaStream_t stream);
88
104template <class T, int blocksize>
105void solveUpperLevelSet(T* reorderedMat,
106 int* rowIndices,
107 int* colIndices,
108 int* indexConversion,
109 int startIdx,
110 int rowsInLevelSet,
111 const T* dInv,
112 T* v,
113 int threadBlockSize,
114 cudaStream_t stream);
115
131template <int blocksize, class LinearSolverScalar, class MatrixScalar, class DiagonalScalar>
132void solveUpperLevelSetSplit(MatrixScalar* reorderedUpperMat,
133 int* rowIndices,
134 int* colIndices,
135 int* indexConversion,
136 int startIdx,
137 int rowsInLevelSet,
138 const DiagonalScalar* dInv,
139 LinearSolverScalar* v,
140 int threadBlockSize,
141 cudaStream_t stream);
142
159template <class T, int blocksize>
160void computeDiluDiagonal(T* reorderedMat,
161 int* rowIndices,
162 int* colIndices,
163 int* reorderedToNatural,
164 int* naturalToReordered,
165 int startIdx,
166 int rowsInLevelSet,
167 T* dInv,
168 int threadBlockSize);
169
191template <int blocksize, class InputScalar, class OutputScalar, MatrixStorageMPScheme>
192void computeDiluDiagonalSplit(const InputScalar* srcReorderedLowerMat,
193 int* lowerRowIndices,
194 int* lowerColIndices,
195 const InputScalar* srcReorderedUpperMat,
196 int* upperRowIndices,
197 int* upperColIndices,
198 const InputScalar* srcDiagonal,
199 int* reorderedToNatural,
200 int* naturalToReordered,
201 int startIdx,
202 int rowsInLevelSet,
203 InputScalar* dInv,
204 OutputScalar* dstDiagonal,
205 OutputScalar* dstLowerMat,
206 OutputScalar* dstUpperMat,
207 int threadBlockSize);
208
209} // namespace Opm::gpuistl::detail::DILU
210#endif
Definition: DILUKernels.hpp:29
void solveLowerLevelSetSplit(MatrixScalar *reorderedUpperMat, int *rowIndices, int *colIndices, int *indexConversion, int startIdx, int rowsInLevelSet, const DiagonalScalar *dInv, const LinearSolverScalar *d, LinearSolverScalar *v, int threadBlockSize, cudaStream_t stream)
Perform a lower solve on certain rows in a matrix that can safely be computed in parallel.
void solveLowerLevelSet(T *reorderedMat, int *rowIndices, int *colIndices, int *indexConversion, int startIdx, int rowsInLevelSet, const T *dInv, 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 solveUpperLevelSet(T *reorderedMat, int *rowIndices, int *colIndices, int *indexConversion, int startIdx, int rowsInLevelSet, const T *dInv, T *v, int threadBlockSize, cudaStream_t stream)
Perform an upper solve on certain rows in a matrix that can safely be computed in parallel.
void computeDiluDiagonal(T *reorderedMat, int *rowIndices, int *colIndices, int *reorderedToNatural, int *naturalToReordered, int startIdx, int rowsInLevelSet, T *dInv, int threadBlockSize)
Computes the ILU0 of the diagonal elements of the reordered matrix and stores it in a reordered vecto...
void computeDiluDiagonalSplit(const InputScalar *srcReorderedLowerMat, int *lowerRowIndices, int *lowerColIndices, const InputScalar *srcReorderedUpperMat, int *upperRowIndices, int *upperColIndices, const InputScalar *srcDiagonal, int *reorderedToNatural, int *naturalToReordered, int startIdx, int rowsInLevelSet, InputScalar *dInv, OutputScalar *dstDiagonal, OutputScalar *dstLowerMat, OutputScalar *dstUpperMat, int threadBlockSize)
Computes the ILU0 of the diagonal elements of the split reordered matrix and stores it in a reordered...
void solveUpperLevelSetSplit(MatrixScalar *reorderedUpperMat, 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.