85 [[nodiscard]]
size_t getSize() const noexcept;
96 [[nodiscard]] virtual
void*
data() = 0;
196 [[nodiscard]]
virtual void*
data();
205 class RMMBuffer :
public Buffer {
207 std::unique_ptr<rmm::device_buffer> _buffer;
210 RMMBuffer() =
delete;
211 RMMBuffer(
const RMMBuffer&) =
delete;
212 RMMBuffer& operator=(RMMBuffer
const&) =
delete;
213 RMMBuffer(RMMBuffer&& o) =
delete;
214 RMMBuffer& operator=(RMMBuffer&& o) =
delete;
216 ~RMMBuffer()
override;
232 explicit RMMBuffer(
const size_t size);
239 explicit RMMBuffer(std::unique_ptr<rmm::device_buffer> rmm_buffer);
267 [[nodiscard]] std::unique_ptr<rmm::device_buffer> release();
289 [[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 void *buffer, const size_t size)
Construct a host buffer by deep copying the contents of another 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