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>
39enum MemoryTraitsFlags {
50 using memory_traits = MemoryTraits<T>;
52 static constexpr unsigned impl_value = T;
54 static constexpr bool is_unmanaged =
55 (unsigned(0) != (T & unsigned(Kokkos::Unmanaged)));
56 static constexpr bool is_random_access =
57 (unsigned(0) != (T & unsigned(Kokkos::RandomAccess)));
58 static constexpr bool is_atomic =
59 (unsigned(0) != (T & unsigned(Kokkos::Atomic)));
60 static constexpr bool is_restrict =
61 (unsigned(0) != (T & unsigned(Kokkos::Restrict)));
62 static constexpr bool is_aligned =
63 (unsigned(0) != (T & unsigned(Kokkos::Aligned)));
72using MemoryManaged = Kokkos::MemoryTraits<0>;
73using MemoryUnmanaged = Kokkos::MemoryTraits<Kokkos::Unmanaged>;
74using MemoryRandomAccess =
75 Kokkos::MemoryTraits<Kokkos::Unmanaged | Kokkos::RandomAccess>;
84static_assert((0 < int(KOKKOS_MEMORY_ALIGNMENT)) &&
85 (0 == (int(KOKKOS_MEMORY_ALIGNMENT) &
86 (int(KOKKOS_MEMORY_ALIGNMENT) - 1))),
87 "KOKKOS_MEMORY_ALIGNMENT must be a power of two");
96 MEMORY_ALIGNMENT = KOKKOS_MEMORY_ALIGNMENT,
97 MEMORY_ALIGNMENT_THRESHOLD = KOKKOS_MEMORY_ALIGNMENT_THRESHOLD
103template <
typename Tp>
104struct is_default_memory_trait : std::false_type {};
107struct is_default_memory_trait<Kokkos::MemoryTraits<0>> : std::true_type {};
ScopeGuard Some user scope issues have been identified with some Kokkos::finalize calls; ScopeGuard a...