20 #include <rmm/detail/aligned.hpp>
60 void* do_allocate(std::size_t bytes,
61 std::size_t alignment = rmm::detail::RMM_DEFAULT_HOST_ALIGNMENT)
override
64 alignment = (rmm::detail::is_supported_alignment(alignment))
66 : rmm::detail::RMM_DEFAULT_HOST_ALIGNMENT;
68 return rmm::detail::aligned_allocate(
69 bytes, alignment, [](std::size_t size) { return ::operator
new(size); });
85 void do_deallocate(
void* ptr,
87 std::size_t alignment = rmm::detail::RMM_DEFAULT_HOST_ALIGNMENT)
override
89 rmm::detail::aligned_deallocate(
90 ptr, bytes, alignment, [](
void* ptr) { ::operator
delete(ptr); });
Base class for host memory allocation.
Definition: host_memory_resource.hpp:54
A host_memory_resource that uses the global operator new and operator delete to allocate host memory.
Definition: new_delete_resource.hpp:36
new_delete_resource & operator=(new_delete_resource &&)=default
Default move assignment operator.
new_delete_resource(new_delete_resource &&)=default
Default move constructor.
new_delete_resource(new_delete_resource const &)=default
Default copy constructor.
new_delete_resource & operator=(new_delete_resource const &)=default
Default copy assignment operator.