10#include <Kokkos_Core.hpp>
23 std::shared_ptr<AllocatorContext> allocContext_ =
nullptr;
27 using exec = Kokkos::Serial;
42 return allocContext_->alloc<T>(elements);
52 return allocContext_->realloc<T>(ptr, elements);
55 void free(
void* ptr)
const noexcept
61 allocContext_->free(ptr);
73 template<
typename ValueType>
76 return Kokkos::View<ValueType*, Kokkos::HostSpace, Kokkos::MemoryUnmanaged>(ptr, size);
79 std::string
name()
const {
return "SerialExecutor"; };
a Logging Mixin class that allows to attach logger to certain classes
T * alloc(sizeType elements) const
SerialExecutor(std::unique_ptr< AllocatorStrategy > strategy)
MemorySpace memorySpace() const noexcept
void free(void *ptr) const noexcept
T * realloc(void *ptr, sizeType elements) const
exec underlyingExec() const
decltype(auto) createKokkosView(ValueType *ptr, sizeType size) const
create a Kokkos view for a given ptr
#define NF_ERROR_EXIT(message)
Macro for printing an error message and aborting the program.
Integer types used throughout NeoN.