IPPL (Independent Parallel Particle Layer)
IPPL
Loading...
Searching...
No Matches
ViewTypes.h
Go to the documentation of this file.
1//
2// Struct ViewType
3// Kokkos::Views of different dimensions.
4//
5#ifndef IPPL_VIEW_TYPES_H
6#define IPPL_VIEW_TYPES_H
7
8#include <Kokkos_Core.hpp>
9
10namespace ippl {
17 namespace detail {
24 template <typename T, int N>
25 struct NPtr {
26 typedef typename NPtr<T, N - 1>::type* type;
27 };
28
32 template <typename T>
33 struct NPtr<T, 1> {
34 typedef T* type;
35 };
36
43 template <typename T, unsigned Dim, class... Properties>
44 struct ViewType {
45 typedef Kokkos::View<typename NPtr<T, Dim>::type, Properties...> view_type;
46 };
47
48 template <typename MemorySpace>
50 } // namespace detail
51} // namespace ippl
52
53#endif
constexpr unsigned Dim
Definition Archive.h:20
typename detail::ViewType< int, 1, MemorySpace >::view_type hash_type
Definition ViewTypes.h:49
NPtr< T, N-1 >::type * type
Definition ViewTypes.h:26
Kokkos::View< typename NPtr< T, Dim >::type, Properties... > view_type
Definition ViewTypes.h:45