10#include <Kokkos_Core.hpp>
24 std::shared_ptr<AllocatorContext> allocContext_ =
nullptr;
28 using exec = Kokkos::DefaultHostExecutionSpace;
43 return allocContext_->alloc<T>(
elements);
56 void free(
void*
ptr)
const noexcept { allocContext_->free(
ptr); }
67 template<
typename ValueType>
70 return Kokkos::View<ValueType*, Kokkos::HostSpace, Kokkos::MemoryUnmanaged>(
ptr, size);
73 std::string
name()
const {
return "CPUExecutor"; };
Executor for handling multicore CPU based parallelization.
T * realloc(void *ptr, size_t elements) const
CPUExecutor(std::unique_ptr< AllocatorStrategy > strategy)
T * alloc(size_t elements) const
exec underlyingExec() const
decltype(auto) createKokkosView(ValueType *ptr, size_t size) const
create a Kokkos view for a given ptr
Kokkos::DefaultHostExecutionSpace exec
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.