opm-simulators
Toggle main menu visibility
Loading...
Searching...
No Matches
gpu_type_detection.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 OPM_GPUISTL_GPU_TYPE_DETECTION_HPP
21
#define OPM_GPUISTL_GPU_TYPE_DETECTION_HPP
22
23
#include <type_traits>
24
25
namespace
Opm::gpuistl
26
{
27
28
// Forward declarations
29
template
<
typename
T>
30
class
GpuVector
;
31
template
<
typename
T>
32
class
GpuSparseMatrixWrapper
;
33
template
<
typename
T>
34
class
GpuSparseMatrixGeneric
;
35
39
template
<
typename
T>
40
struct
is_gpu_type
: std::false_type {
41
};
42
43
// Specializations for known GPU types
44
template
<
typename
T>
45
struct
is_gpu_type
<
GpuVector
<T>> : std::true_type {
46
};
47
48
template
<
typename
T>
49
struct
is_gpu_type
<
GpuSparseMatrixWrapper
<T>> : std::true_type {
50
};
51
52
template
<
typename
T>
53
struct
is_gpu_type
<
GpuSparseMatrixGeneric
<T>> : std::true_type {
54
};
55
59
template
<
typename
T>
60
inline
constexpr
bool
is_gpu_type_v =
is_gpu_type<T>::value
;
61
62
}
// namespace Opm::gpuistl
63
64
#endif
// OPM_GPUISTL_GPU_TYPE_DETECTION_HPP
Opm::gpuistl::GpuSparseMatrixGeneric
The GpuSparseMatrixGeneric class uses cuSPARSE Generic API for sparse matrix operations.
Definition
GpuSparseMatrixGeneric.hpp:51
Opm::gpuistl::GpuSparseMatrixWrapper
The GpuSparseMatrixWrapper Checks CUDA/HIP version and dispatches a version either using the old or t...
Definition
GpuSparseMatrixWrapper.hpp:61
Opm::gpuistl::GpuVector
Definition
gpu_type_detection.hpp:30
Opm::gpuistl::is_gpu_type
Type trait to detect if a type is a GPU type.
Definition
gpu_type_detection.hpp:40
opm
simulators
linalg
gpuistl
detail
gpu_type_detection.hpp
Generated by
1.17.0