Loading...
Searching...
No Matches
ILU0Kernels.hpp
/*
Copyright 2024 SINTEF AS
This file is part of the Open Porous Media project (OPM).
OPM is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OPM is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with OPM. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef OPM_ILU0_KERNELS_HPP
#define OPM_ILU0_KERNELS_HPP
#include <cstddef>
#include <vector>
#include <opm/simulators/linalg/gpuistl/detail/kernel_enums.hpp>
namespace Opm::gpuistl::detail::ILU0
{
template <class T, int blocksize>
void solveUpperLevelSet(T* reorderedMat,
int* rowIndices,
int* colIndices,
int* indexConversion,
int startIdx,
int rowsInLevelSet,
T* v,
int threadBlockSize,
cudaStream_t stream);
template <class T, int blocksize>
void solveLowerLevelSet(T* reorderedMat,
int* rowIndices,
int* colIndices,
int* indexConversion,
int startIdx,
int rowsInLevelSet,
const T* d,
T* v,
int threadBlockSize,
cudaStream_t stream);
template <int blocksize, class LinearSolverScalar, class MatrixScalar, class DiagonalScalar>
void solveUpperLevelSetSplit(MatrixScalar* reorderedMat,
int* rowIndices,
int* colIndices,
int* indexConversion,
int startIdx,
int rowsInLevelSet,
const DiagonalScalar* dInv,
LinearSolverScalar* v,
int threadBlockSize,
cudaStream_t stream);
template <int blocksize, class LinearSolverScalar, class MatrixScalar>
void solveLowerLevelSetSplit(MatrixScalar* reorderedLowerMat,
int* rowIndices,
int* colIndices,
int* indexConversion,
int startIdx,
int rowsInLevelSet,
const LinearSolverScalar* d,
LinearSolverScalar* v,
int threadBlockSize,
cudaStream_t stream);
template <class T, int blocksize>
void LUFactorization(T* reorderedMat,
int* rowIndices,
int* columnIndices,
int* naturalToReordered,
int* reorderedToNatual,
size_t rowsInLevelSet,
int startIdx,
int threadBlockSize);
template <int blocksize, class InputScalar, class OutputScalar, MatrixStorageMPScheme mixedPrecisionScheme>
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);
} // namespace Opm::gpuistl::detail::ILU0
#endif