PACMAN
0.1.0
Portable Algorithms for Coupling, Mapping, and Adaptive iNterpolation
Loading...
Searching...
No Matches
concepts.hpp
Go to the documentation of this file.
1
//
2
// This file is subject to the terms and conditions defined in
3
// file 'LICENSE', which is part of this source code package.
4
//
5
6
#pragma once
7
8
#include <Kokkos_Core.hpp>
9
#include <concepts>
10
#include <type_traits>
11
12
#include "
common/types.hpp
"
13
14
namespace
PACMAN
{
15
/* Type Evaluation */
16
17
template
<
typename
>
struct
is_kokkos_view
: std::false_type {};
18
19
template
<
typename
DataType,
typename
... P>
20
struct
is_kokkos_view
<Kokkos::View<DataType, P...>> : std::true_type {};
21
22
template
<
typename
>
struct
is_kokkos_array
: std::false_type {};
23
24
template
<
typename
T,
size_t
N>
25
struct
is_kokkos_array
<Kokkos::Array<T, N>> : std::true_type {};
26
27
/* Type Constraints */
28
29
template
<
typename
T>
30
concept
IsKokkosView
= is_kokkos_view<std::remove_cv_t<T>>::value;
31
32
template
<
typename
T,
int
R>
33
concept
IsRank
= std::remove_cv_t<T>::rank == R;
34
35
template
<
class
T>
36
concept
IsRBFFunction
=
requires
(
const
T t,
const
double
x) {
37
{ t.Eval(x) } -> std::floating_point;
38
};
39
40
template
<
class
T>
41
concept
IsKokkosArray
= is_kokkos_array<std::remove_cv_t<T>>::value;
42
43
template
<
int
_t Dim>
44
concept
IsValidDim
= (Dim >= 1 && Dim <= 3);
45
46
/* Concepts as type */
47
48
template
<
typename
T,
int
R>
49
concept
KokkosViewRank
=
IsKokkosView<T>
&&
IsRank<T, R>
;
50
51
template
<
typename
T>
52
concept
KokkosArray
=
IsKokkosArray<T>
;
53
54
template
<
typename
T>
55
concept
RBFFunction
=
IsRBFFunction<T>
;
56
57
}
// namespace PACMAN
PACMAN::IsKokkosArray
Definition
concepts.hpp:41
PACMAN::IsKokkosView
Definition
concepts.hpp:30
PACMAN::IsRBFFunction
Definition
concepts.hpp:36
PACMAN::IsRank
Definition
concepts.hpp:33
PACMAN::IsValidDim
Definition
concepts.hpp:44
PACMAN::KokkosArray
Definition
concepts.hpp:52
PACMAN::KokkosViewRank
Definition
concepts.hpp:49
PACMAN::RBFFunction
Definition
concepts.hpp:55
PACMAN
Definition
concepts.hpp:14
PACMAN::is_kokkos_array
Definition
concepts.hpp:22
PACMAN::is_kokkos_view
Definition
concepts.hpp:17
types.hpp
src
common
concepts.hpp
Generated on Sat Jul 18 2026 00:03:16 for PACMAN by
1.9.8