15 #include <rapidsmpf/error.hpp>
62 "only async stream-ordered allocation must be used in RapidsMPF",
74 "only async stream-ordered allocation must be used in RapidsMPF",
162 static_assert(cuda::mr::resource<HostMemoryResource>);
163 static_assert(cuda::mr::resource_with<HostMemoryResource, cuda::mr::host_accessible>);
164 static_assert(!cuda::mr::resource_with<HostMemoryResource, cuda::mr::device_accessible>);
Host memory resource using standard CPU allocation.
virtual void deallocate(rmm::cuda_stream_view stream, void *ptr, std::size_t size, std::size_t alignment=rmm::CUDA_ALLOCATION_ALIGNMENT) noexcept
Deallocates host memory associated with a CUDA stream.
virtual ~HostMemoryResource()=default
Virtual destructor to allow polymorphic use.
HostMemoryResource & operator=(HostMemoryResource const &)=default
Copy assignment.
void * allocate_sync(std::size_t, std::size_t)
Synchronously allocates host memory is disabled.
HostMemoryResource & operator=(HostMemoryResource &&)=default
Move assignment.
void deallocate_sync(void *, std::size_t, std::size_t)
Synchronously deallocates host memory is disabled.
bool operator==(HostMemoryResource const &other) const noexcept
Compares this resource to another resource.
HostMemoryResource(HostMemoryResource &&)=default
Movable.
virtual bool is_equal([[maybe_unused]] HostMemoryResource const &other) const noexcept
Compares this resource to another resource.
virtual void * allocate(rmm::cuda_stream_view stream, std::size_t size, std::size_t alignment=rmm::CUDA_ALLOCATION_ALIGNMENT)
Allocates host memory associated with a CUDA stream.
friend void get_property(HostMemoryResource const &, cuda::mr::host_accessible) noexcept
Enables the cuda::mr::host_accessible property.
HostMemoryResource()=default
Default constructor.
bool operator!=(HostMemoryResource const &other) const noexcept
Compares this resource to another resource.
HostMemoryResource(HostMemoryResource const &)=default
Copyable.
static constexpr std::size_t CUDA_ALLOCATION_ALIGNMENT