11#include <Kokkos_Core.hpp>
25 std::shared_ptr<AllocatorContext> allocContext_ =
nullptr;
29 using exec = Kokkos::DefaultHostExecutionSpace;
44 return allocContext_->alloc<T>(elements);
54 return allocContext_->realloc<T>(ptr, elements);
57 void free(
void* ptr)
const noexcept { allocContext_->free(ptr); }
68 template<
typename ValueType>
71 return Kokkos::View<ValueType*, Kokkos::HostSpace, Kokkos::MemoryUnmanaged>(ptr, size);
74 std::string
name()
const {
return "CPUExecutor"; };
CPUExecutor(std::unique_ptr< AllocatorStrategy > strategy)
T * alloc(sizeType elements) const
exec underlyingExec() const
decltype(auto) createKokkosView(ValueType *ptr, sizeType size) const
create a Kokkos view for a given ptr
Kokkos::DefaultHostExecutionSpace exec
T * realloc(void *ptr, sizeType elements) const
MemorySpace memorySpace() const noexcept
void free(void *ptr) const noexcept
a Logging Mixin class that allows to attach logger to certain classes
#define NF_ERROR_EXIT(message)
Macro for printing an error message and aborting the program.
Integer types used throughout NeoN.