-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathkokkos_aliases.h
36 lines (28 loc) · 1.07 KB
/
kokkos_aliases.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#ifndef kokkos_aliases
#define kokkos_aliases
// Kokkos aliases
template <typename _TYPE_>
using View = Kokkos::View<_TYPE_ *>;
using Device = Kokkos::DefaultExecutionSpace;
using Host = Kokkos::DefaultHostExecutionSpace;
using HostPinned = Kokkos::SharedHostPinnedSpace;
template <typename _TYPE_>
using HostView = Kokkos::View<_TYPE_ *, Host>;
template <typename _TYPE_>
using HostPinnedView = Kokkos::View<_TYPE_ *, HostPinned>;
using policy_t = Kokkos::RangePolicy<Device>;
using team_policy_t = Kokkos::TeamPolicy<Device>;
using member_type = team_policy_t::member_type;
using ScratchSpace = Device::scratch_memory_space;
using Unmanaged = Kokkos::MemoryTraits<Kokkos::Unmanaged>;
//Scratch views must be unmanaged
template <typename _TYPE_>
using ScratchView = Kokkos::View<_TYPE_ *, ScratchSpace, Unmanaged>;
//Subviews
template <typename _TYPE_>
using Subview = Kokkos::Subview<View<_TYPE_>>;
template <typename _TYPE_>
using HostSubview = Kokkos::Subview<HostView<_TYPE_>>;
template <typename _TYPE_>
using HostPinnedViewSubview = Kokkos::Subview<HostPinnedView<_TYPE_>>;
#endif