10#include <Kokkos_Core.hpp>
25 std::shared_ptr<AllocatorContext> allocContext_ =
nullptr;
29 using exec = Kokkos::DefaultExecutionSpace;
45 return allocContext_->alloc<T>(
elements);
64 allocContext_->free(
ptr);
76 template<
typename ValueType>
79 return Kokkos::View<ValueType*, Kokkos::DefaultExecutionSpace, Kokkos::MemoryUnmanaged>(
84 std::string
name()
const {
return "GPUExecutor"; };
Executor for GPU offloading.
T * alloc(size_t elements) const
T * realloc(void *ptr, size_t elements) const
GPUExecutor(std::unique_ptr< AllocatorStrategy > strategy)
Kokkos::DefaultExecutionSpace exec
MemorySpace memorySpace() const noexcept
decltype(auto) createKokkosView(ValueType *ptr, size_t size) const
create a Kokkos view for a given ptr
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.