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>
40enum MemoryTraitsFlags {
48template <
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
77using MemoryRandomAccess =
93#ifdef KOKKOS_ENABLE_DEPRECATED_CODE_4
95static constexpr unsigned MEMORY_ALIGNMENT_THRESHOLD =
96 KOKKOS_IMPL_MEMORY_ALIGNMENT_THRESHOLD;
99static constexpr unsigned MEMORY_ALIGNMENT_THRESHOLD = 1;
102 "MEMORY_ALIGNMENT must be a power of 2");
107template <
typename Tp>
108struct is_default_memory_trait : std::false_type {};
111struct is_default_memory_trait<Kokkos::MemoryTraits<>> : std::true_type {};
A thread safe view to a bitset.
static constexpr unsigned MEMORY_ALIGNMENT
Memory alignment settings.