17 #ifndef KOKKOS_IMPL_PUBLIC_INCLUDE
18 #include <Kokkos_Macros.hpp>
20 "Including non-public Kokkos header files is not allowed.");
22 #ifndef KOKKOS_MEMORYTRAITS_HPP
23 #define KOKKOS_MEMORYTRAITS_HPP
25 #include <impl/Kokkos_Traits.hpp>
26 #include <Kokkos_BitManipulation.hpp>
40 enum MemoryTraitsFlags {
48 template <
unsigned T = 0>
51 using memory_traits = MemoryTraits<T>;
53 static constexpr
unsigned impl_value = T;
55 static constexpr
bool is_unmanaged =
56 (unsigned(0) != (T & unsigned(Kokkos::Unmanaged)));
57 static constexpr
bool is_random_access =
58 (unsigned(0) != (T & unsigned(Kokkos::RandomAccess)));
59 static constexpr
bool is_atomic =
60 (unsigned(0) != (T & unsigned(Kokkos::Atomic)));
61 static constexpr
bool is_restrict =
62 (unsigned(0) != (T & unsigned(Kokkos::Restrict)));
63 static constexpr
bool is_aligned =
64 (unsigned(0) != (T & unsigned(Kokkos::Aligned)));
73 #ifdef KOKKOS_ENABLE_DEPRECATED_CODE_4
74 using MemoryManaged KOKKOS_DEPRECATED = Kokkos::MemoryTraits<>;
76 using MemoryUnmanaged = Kokkos::MemoryTraits<Kokkos::Unmanaged>;
77 using MemoryRandomAccess =
78 Kokkos::MemoryTraits<Kokkos::Unmanaged | Kokkos::RandomAccess>;
93 #ifdef KOKKOS_ENABLE_DEPRECATED_CODE_4
95 static constexpr
unsigned MEMORY_ALIGNMENT_THRESHOLD =
96 KOKKOS_IMPL_MEMORY_ALIGNMENT_THRESHOLD;
99 static constexpr
unsigned MEMORY_ALIGNMENT_THRESHOLD = 1;
102 "MEMORY_ALIGNMENT must be a power of 2");
107 template <
typename Tp>
108 struct is_default_memory_trait : std::false_type {};
111 struct is_default_memory_trait<Kokkos::MemoryTraits<>> : std::true_type {};
static constexpr unsigned MEMORY_ALIGNMENT