18 #include <rmm/cuda_stream_view.hpp>
19 #include <rmm/detail/aligned.hpp>
108 return do_allocate(bytes, stream);
131 do_deallocate(ptr, bytes, stream);
149 return do_is_equal(other);
177 return do_get_mem_info(stream);
206 virtual void do_deallocate(
void* ptr, std::size_t bytes,
cuda_stream_view stream) = 0;
224 return this == &other;
235 [[nodiscard]]
virtual std::pair<std::size_t, std::size_t> do_get_mem_info(
virtual bool supports_streams() const noexcept=0
Query whether the resource supports use of non-null CUDA streams for allocation/deallocation.
void * allocate(std::size_t bytes, cuda_stream_view stream=cuda_stream_view{})
Allocates memory of size at least bytes.
Definition: device_memory_resource.hpp:106
Strongly-typed non-owning wrapper for CUDA streams with default constructor.
Definition: cuda_stream_view.hpp:34
void deallocate(void *ptr, std::size_t bytes, cuda_stream_view stream=cuda_stream_view{})
Deallocate memory pointed to by p.
Definition: device_memory_resource.hpp:129
bool is_equal(device_memory_resource const &other) const noexcept
Compare this resource to another.
Definition: device_memory_resource.hpp:147
virtual bool supports_get_mem_info() const noexcept=0
Query whether the resource supports the get_mem_info API.
std::pair< std::size_t, std::size_t > get_mem_info(cuda_stream_view stream) const
Queries the amount of free and total memory for the resource.
Definition: device_memory_resource.hpp:175
Base class for all libcudf device memory allocation.
Definition: device_memory_resource.hpp:82