opm-simulators
ILU_variants_helper_kernels.hpp
1 /*
2  Copyright 2025 Equinor ASA
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 
20 #ifndef ILU_VARIANTS_HELPER_KERNELS_HPP
21 #define ILU_VARIANTS_HELPER_KERNELS_HPP
22 
23 #include <cuda.h>
24 #include <cuda_runtime.h>
25 #include <opm/simulators/linalg/gpuistl/detail/gpuThreadUtils.hpp>
26 #include <opm/simulators/linalg/gpuistl/detail/gpu_safe_call.hpp>
27 
28 namespace Opm::gpuistl::detail
29 {
30 
31 /*
32  The computeDiagIndices(NoReorder) functions are used to speed up the factorization time by
33  not recomputing indices during each update kernel.
34 */
45 template <class T>
46 void computeDiagIndicesNoReorder(const int* rowIndices,
47  const int* colIndices,
48  const size_t* indexConversion,
49  int rows,
50  size_t* diagIndices);
51 
62 template <class T>
63 void computeDiagIndices(const int* rowIndices,
64  const int* colIndices,
65  const int* reorderedToNatural,
66  int rows,
67  size_t* diagIndices);
68 
69 } // namespace Opm::gpuistl::detail
70 
71 #endif
void computeDiagIndicesNoReorder(const int *rowIndices, const int *colIndices, const size_t *indexConversion, int rows, size_t *diagIndices)
Computes indices of diagonal elements for non-reordered GPU preconditioner.
void computeDiagIndices(const int *rowIndices, const int *colIndices, const int *reorderedToNatural, int rows, size_t *diagIndices)
Computes indices of diagonal elements for reordered GPU preconditioner.
Contains wrappers to make the CuBLAS library behave as a modern C++ library with function overlading...
Definition: autotuner.hpp:29