A simple object containing a host buffer. More...
#include <buffer.h>
Public Member Functions | |
HostBuffer (const HostBuffer &)=delete | |
HostBuffer & | operator= (HostBuffer const &)=delete |
HostBuffer (HostBuffer &&o)=delete | |
HostBuffer & | operator= (HostBuffer &&o)=delete |
HostBuffer (const size_t size) | |
Constructor of concrete type HostBuffer . More... | |
~HostBuffer () | |
Destructor of concrete type HostBuffer . More... | |
void * | release () |
Release the allocated host buffer to the caller. More... | |
virtual void * | data () |
Get a pointer to the allocated raw host buffer. More... | |
![]() | |
Buffer (const Buffer &)=delete | |
Buffer & | operator= (Buffer const &)=delete |
Buffer (Buffer &&o)=delete | |
Buffer & | operator= (Buffer &&o)=delete |
virtual | ~Buffer () |
Virtual destructor. More... | |
BufferType | getType () const noexcept |
Get the type of buffer the object holds. More... | |
size_t | getSize () const noexcept |
Get the size of the contained buffer. More... | |
Additional Inherited Members | |
![]() | |
Buffer (const BufferType bufferType, const size_t size) | |
Protected constructor of abstract type Buffer . More... | |
![]() | |
BufferType | _bufferType {BufferType::Invalid} |
Buffer type. | |
size_t | _size |
Buffer size. | |
A simple object containing a host buffer.
A buffer encapsulating a host buffer with its properties.
|
explicit |
Constructor of concrete type HostBuffer
.
Constructor to materialize a buffer holding host memory. The internal buffer is allocated using malloc
, and thus should be freed with free
.
[in] | size | the size of the host buffer to allocate. |
ucxx::HostBuffer::~HostBuffer | ( | ) |
Destructor of concrete type HostBuffer
.
Frees the underlying buffer, unless the underlying buffer was released to the user after a call to release
.
|
virtual |
Get a pointer to the allocated raw host buffer.
Get a pointer to the underlying buffer, but does not release ownership.
std::runtime_error | if object has been released. |
Implements ucxx::Buffer.
void* ucxx::HostBuffer::release | ( | ) |
Release the allocated host buffer to the caller.
Release ownership of the buffer to the caller. After this method is called, the caller becomes responsible for its deallocation once it is not needed anymore. The buffer is allocated with malloc
, and should be properly disposed of by a call to free
.
The original HostBuffer
object becomes invalid.
std::runtime_error | if object has been released. |