11#include <Kokkos_Core.hpp>
15template <
class T,
class MemorySpace>
21 <= std::max(
alignof(std::max_align_t),
alignof(Kokkos::complex<
long double>)),
22 "Alignment not supported");
27 using memory_space = MemorySpace;
59 return static_cast<T*>(Kokkos::kokkos_malloc<MemorySpace>(
sizeof(T) * n));
64 return static_cast<T*>(Kokkos::kokkos_malloc<MemorySpace>(label,
sizeof(T) * n));
69 Kokkos::kokkos_free(p);
73template <
class T,
class MST,
class U,
class MSU>
79#if !defined(__cpp_impl_three_way_comparison) || __cpp_impl_three_way_comparison < 201902L
81template <
class T,
class MST,
class U,
class MSU>
89using 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