13 #include <rmm/device_buffer.hpp>
84 [[nodiscard]]
size_t getSize() const noexcept;
95 [[nodiscard]] virtual
void*
data() = 0;
183 [[nodiscard]]
virtual void*
data();
192 class RMMBuffer :
public Buffer {
194 std::unique_ptr<rmm::device_buffer> _buffer;
197 RMMBuffer() =
delete;
198 RMMBuffer(
const RMMBuffer&) =
delete;
199 RMMBuffer& operator=(RMMBuffer
const&) =
delete;
200 RMMBuffer(RMMBuffer&& o) =
delete;
201 RMMBuffer& operator=(RMMBuffer&& o) =
delete;
217 explicit RMMBuffer(
const size_t size);
245 [[nodiscard]] std::unique_ptr<rmm::device_buffer> release();
267 [[nodiscard]]
virtual void*
data();
A simple object to simplify managing buffers.
Definition: buffer.h:37
Buffer(const BufferType bufferType, const size_t size)
Protected constructor of abstract type Buffer.
virtual ~Buffer()
Virtual destructor.
BufferType _bufferType
Buffer type.
Definition: buffer.h:39
size_t getSize() const noexcept
Get the size of the contained buffer.
BufferType getType() const noexcept
Get the type of buffer the object holds.
size_t _size
Buffer size.
Definition: buffer.h:40
virtual void * data()=0
Abstract method returning void pointer to buffer.
A simple object containing a host buffer.
Definition: buffer.h:103
void * release()
Release the allocated host buffer to the caller.
~HostBuffer()
Destructor of concrete type HostBuffer.
virtual void * data()
Get a pointer to the allocated raw host buffer.
HostBuffer(const size_t size)
Constructor of concrete type HostBuffer.
std::shared_ptr< Buffer > allocateBuffer(BufferType bufferType, const size_t size)
Allocate a buffer of specified type and size.
BufferType
The type of a buffer.
Definition: buffer.h:23