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
14namespace PACMAN {
15/* Type Evaluation */
16
17template <typename> struct is_kokkos_view : std::false_type {};
18
19template <typename DataType, typename... P>
20struct is_kokkos_view<Kokkos::View<DataType, P...>> : std::true_type {};
21
22template <typename> struct is_kokkos_array : std::false_type {};
23
24template <typename T, size_t N>
25struct is_kokkos_array<Kokkos::Array<T, N>> : std::true_type {};
26
27/* Type Constraints */
28
29template <typename T>
30concept IsKokkosView = is_kokkos_view<std::remove_cv_t<T>>::value;
31
32template <typename T, int R>
33concept IsRank = std::remove_cv_t<T>::rank == R;
34
35template <class T>
36concept IsRBFFunction = requires(const T t, const double x) {
37 { t.Eval(x) } -> std::floating_point;
38};
39
40template <class T>
41concept IsKokkosArray = is_kokkos_array<std::remove_cv_t<T>>::value;
42
43template <int_t Dim>
44concept IsValidDim = (Dim >= 1 && Dim <= 3);
45
46/* Concepts as type */
47
48template <typename T, int R>
50
51template <typename T>
53
54template <typename T>
56
57} // namespace PACMAN