85 [[nodiscard]]
size_t getSize() const noexcept;
96 [[nodiscard]] virtual
void*
data() = 0;
184 [[nodiscard]]
virtual void*
data();
193 class RMMBuffer :
public Buffer {
195 std::unique_ptr<rmm::device_buffer> _buffer;
198 RMMBuffer() =
delete;
199 RMMBuffer(
const RMMBuffer&) =
delete;
200 RMMBuffer& operator=(RMMBuffer
const&) =
delete;
201 RMMBuffer(RMMBuffer&& o) =
delete;
202 RMMBuffer& operator=(RMMBuffer&& o) =
delete;
218 explicit RMMBuffer(
const size_t size);
246 [[nodiscard]] std::unique_ptr<rmm::device_buffer> release();
268 [[nodiscard]]
virtual void*
data();
A simple object to simplify managing buffers.
Definition: buffer.h:38
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:40
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:41
virtual void * data()=0
Abstract method returning void pointer to buffer.
A simple object containing a host buffer.
Definition: buffer.h:104
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:24