11#include <Kokkos_Core.hpp>
15template <
class T,
class MemorySpace>
21 using memory_space = MemorySpace;
53 return static_cast<T*>(Kokkos::kokkos_malloc<MemorySpace>(
sizeof(T) * n));
58 return static_cast<T*>(Kokkos::kokkos_malloc<MemorySpace>(label,
sizeof(T) * n));
63 Kokkos::kokkos_free(p);
67template <
class T,
class MST,
class U,
class MSU>
73#if !defined(__cpp_impl_three_way_comparison) || __cpp_impl_three_way_comparison < 201902L
75template <
class T,
class MST,
class U,
class MSU>
83using DeviceAllocator =
KokkosAllocator<T, Kokkos::DefaultExecutionSpace::memory_space>;
constexpr KokkosAllocator(KokkosAllocator< U, MemorySpace > const &) noexcept
void deallocate(T *p, std::size_t) const
T * allocate(std::size_t n) const
constexpr KokkosAllocator(KokkosAllocator &&x) noexcept=default
constexpr KokkosAllocator & operator=(KokkosAllocator const &x)=default
~KokkosAllocator()=default
constexpr KokkosAllocator & operator=(KokkosAllocator< U, MemorySpace > const &) noexcept
constexpr KokkosAllocator()=default
constexpr KokkosAllocator & operator=(KokkosAllocator &&x) noexcept=default
constexpr KokkosAllocator(KokkosAllocator const &x)=default
T * allocate(std::string const &label, std::size_t n) const
The top-level namespace of DDC.
constexpr bool operator==(KokkosAllocator< T, MST > const &, KokkosAllocator< U, MSU > const &) noexcept