45 #ifndef KOKKOS_MEMORYTRAITS_HPP 46 #define KOKKOS_MEMORYTRAITS_HPP 48 #include <impl/Kokkos_Traits.hpp> 49 #include <impl/Kokkos_Tags.hpp> 63 enum MemoryTraitsFlags {
74 using memory_traits = MemoryTraits<T>;
76 is_unmanaged = (unsigned(0) != (T & unsigned(Kokkos::Unmanaged)))
79 is_random_access = (unsigned(0) != (T & unsigned(Kokkos::RandomAccess)))
81 enum :
bool { is_atomic = (unsigned(0) != (T & unsigned(Kokkos::Atomic))) };
83 is_restrict = (unsigned(0) != (T & unsigned(Kokkos::Restrict)))
85 enum :
bool { is_aligned = (unsigned(0) != (T & unsigned(Kokkos::Aligned))) };
94 using MemoryManaged = Kokkos::MemoryTraits<0>;
95 using MemoryUnmanaged = Kokkos::MemoryTraits<Kokkos::Unmanaged>;
96 using MemoryRandomAccess =
97 Kokkos::MemoryTraits<Kokkos::Unmanaged | Kokkos::RandomAccess>;
106 static_assert((0 <
int(KOKKOS_MEMORY_ALIGNMENT)) &&
107 (0 == (
int(KOKKOS_MEMORY_ALIGNMENT) &
108 (
int(KOKKOS_MEMORY_ALIGNMENT) - 1))),
109 "KOKKOS_MEMORY_ALIGNMENT must be a power of two");
118 MEMORY_ALIGNMENT = KOKKOS_MEMORY_ALIGNMENT,
119 MEMORY_ALIGNMENT_THRESHOLD = KOKKOS_MEMORY_ALIGNMENT_THRESHOLD