#include <CE_VDBCreate.h>
Definition at line 59 of file CE_VDBCreate.h.
nanovdb::OclDeviceBuffer::OclDeviceBuffer |
( |
uint64_t |
size = 0 , |
|
|
bool |
host = true |
|
) |
| |
|
inline |
Constructor.
- Parameters
-
size | byte size of buffer to be initialized |
host | If true buffer is initialized only on the host/CPU, else on the device/GPU |
Definition at line 75 of file CE_VDBCreate.h.
Disallow copy-construction.
nanovdb::OclDeviceBuffer::~OclDeviceBuffer |
( |
| ) |
|
|
inline |
Destructor frees memory on both the host and device.
Definition at line 114 of file CE_VDBCreate.h.
void nanovdb::OclDeviceBuffer::clear |
( |
| ) |
|
|
inline |
De-allocate all memory managed by this allocator and set all pointers to NULL.
Definition at line 217 of file CE_VDBCreate.h.
OclDeviceBuffer nanovdb::OclDeviceBuffer::create |
( |
uint64_t |
size, |
|
|
bool |
host = true |
|
) |
| |
|
inlinestatic |
Static factory method that return an instance of this buffer.
- Parameters
-
size | byte size of buffer to be initialized |
host | If true buffer is initialized only on the host/CPU, else on the device/GPU |
- Returns
- An instance of this class using move semantics
Definition at line 167 of file CE_VDBCreate.h.
uint8_t* nanovdb::OclDeviceBuffer::data |
( |
| ) |
const |
|
inline |
Retuns a raw pointer to the host/CPU buffer managed by this allocator.
- Warning
- Note that the pointer can be NULL!
Definition at line 125 of file CE_VDBCreate.h.
const cl::Buffer& nanovdb::OclDeviceBuffer::deviceData |
( |
| ) |
const |
|
inline |
Retuns a cl::Buffer ref to the device/GPU buffer managed by this allocator.
- Warning
- Note that the pointer can be NULL!
Definition at line 129 of file CE_VDBCreate.h.
void nanovdb::OclDeviceBuffer::deviceDownload |
( |
void * |
stream = nullptr , |
|
|
bool |
sync = true |
|
) |
| |
|
inline |
Upload this buffer from the device to the host, i.e. GPU -> CPU.
- Parameters
-
stream | optional stream (defaults to stream 0) (never used) |
sync | if false the memory copy is asynchronous (never used) |
- Note
- If the host/CPU buffer does not exist it is first allocated
- Warning
- Assumes that the device/GPU buffer already exists
Definition at line 204 of file CE_VDBCreate.h.
void nanovdb::OclDeviceBuffer::deviceUpload |
( |
void * |
stream = nullptr , |
|
|
bool |
sync = true |
|
) |
| |
|
inline |
Upload this buffer from the host to the device, i.e. CPU -> GPU.
- Parameters
-
stream | optional stream (defaults to stream 0) (never used) |
sync | if false the memory copy is asynchronous (never used) |
- Note
- If the device/GPU buffer does not exist it is first allocated
- Warning
- Assumes that the host/CPU buffer already exists
Definition at line 191 of file CE_VDBCreate.h.
bool nanovdb::OclDeviceBuffer::empty |
( |
| ) |
const |
|
inline |
Returns true if this allocator is empty, i.e. has no allocated memory.
Definition at line 150 of file CE_VDBCreate.h.
void nanovdb::OclDeviceBuffer::init |
( |
uint64_t |
size, |
|
|
bool |
host = true |
|
) |
| |
|
inline |
Initialize buffer.
- Parameters
-
size | byte size of buffer to be initialized |
host | If true buffer is initialized only on the host/CPU, else on the device/GPU |
- Note
- All existing buffers are first cleared
- Warning
- size is expected to be non-zero. Use clear() clear buffer!
Definition at line 172 of file CE_VDBCreate.h.
bool nanovdb::OclDeviceBuffer::isEmpty |
( |
| ) |
const |
|
inline |
Returns true if this allocator is empty, i.e. has no allocated memory.
Definition at line 151 of file CE_VDBCreate.h.
Disallow copy assignment operation.
uint64_t nanovdb::OclDeviceBuffer::size |
( |
| ) |
const |
|
inline |
Returns the size in bytes of the raw memory buffer managed by this allocator.
Definition at line 146 of file CE_VDBCreate.h.
The documentation for this class was generated from the following file: