5#include <Kokkos_Core.hpp>
20 using exec = Kokkos::Serial;
28 return static_cast<T*
>(Kokkos::kokkos_malloc<exec>(
"Field", size *
sizeof(T)));
32 T*
realloc(
void* ptr,
size_t newSize)
const
34 return static_cast<T*
>(Kokkos::kokkos_realloc<exec>(ptr, newSize *
sizeof(T)));
44 template<
typename ValueType>
47 return Kokkos::View<ValueType*, Kokkos::HostSpace, Kokkos::MemoryUnmanaged>(ptr, size);
50 void*
alloc(
size_t size)
const {
return Kokkos::kokkos_malloc<exec>(
"Field", size); }
52 void*
realloc(
void* ptr,
size_t newSize)
const
54 return Kokkos::kokkos_realloc<exec>(ptr, newSize);
57 void free(
void* ptr)
const noexcept { Kokkos::kokkos_free<exec>(ptr); };
59 std::string
name()
const {
return "SerialExecutor"; };
Reference executor for serial CPU execution.
void free(void *ptr) const noexcept
decltype(auto) createKokkosView(ValueType *ptr, size_t size) const
create a Kokkos view for a given ptr
T * realloc(void *ptr, size_t newSize) const
T * alloc(size_t size) const
void * alloc(size_t size) const
void * realloc(void *ptr, size_t newSize) const