7#include <Kokkos_Core.hpp>
29 std::shared_ptr<AllocatorContext> allocContext_ =
nullptr;
33 using exec = Kokkos::DefaultExecutionSpace;
49 return allocContext_->alloc<T>(elements);
59 return allocContext_->realloc<T>(ptr, elements);
62 void free(
void* ptr)
const noexcept
68 allocContext_->free(ptr);
80 template<
typename ValueType>
83 return Kokkos::View<ValueType*, Kokkos::DefaultExecutionSpace, Kokkos::MemoryUnmanaged>(
88 std::string
name()
const {
return "GPUExecutor"; };
decltype(auto) createKokkosView(ValueType *ptr, sizeType size) const
create a Kokkos view for a given ptr
GPUExecutor(std::unique_ptr< AllocatorStrategy > strategy)
T * realloc(void *ptr, sizeType elements) const
T * alloc(sizeType elements) const
Kokkos::DefaultExecutionSpace exec
MemorySpace memorySpace() const noexcept
exec underlyingExec() const
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.