OpenVDB
9.0.1
|
Simple memory buffer using un-managed pinned host memory when compiled with NVCC. Obviously this class is making explicit used of CUDA so replace it with your own memory allocator if you are not using CUDA. More...
#include <nanovdb/util/CudaDeviceBuffer.h>
Public Member Functions | |
CudaDeviceBuffer (uint64_t size=0) | |
CudaDeviceBuffer (const CudaDeviceBuffer &)=delete | |
Disallow copy-construction. More... | |
CudaDeviceBuffer (CudaDeviceBuffer &&other) noexcept | |
Move copy-constructor. More... | |
CudaDeviceBuffer & | operator= (const CudaDeviceBuffer &)=delete |
Disallow copy assignment operation. More... | |
CudaDeviceBuffer & | operator= (CudaDeviceBuffer &&other) noexcept |
Move copy assignment operation. More... | |
~CudaDeviceBuffer () | |
Destructor frees memory on both the host and device. More... | |
void | init (uint64_t size) |
uint8_t * | data () const |
uint8_t * | deviceData () const |
void | deviceUpload (void *stream=0, bool sync=true) const |
Copy grid from the CPU/host to the GPU/device. If sync is false the memory copy is asynchronous! More... | |
void | deviceDownload (void *stream=0, bool sync=true) const |
Copy grid from the GPU/device to the CPU/host. If sync is false the memory copy is asynchronous! More... | |
uint64_t | size () const |
Returns the size in bytes of the raw memory buffer managed by this allocator. More... | |
bool | empty () const |
Returns true if this allocator is empty, i.e. has no allocated memory. More... | |
void | clear () |
De-allocate all memory managed by this allocator and set all pointer to NULL. More... | |
Static Public Member Functions | |
static CudaDeviceBuffer | create (uint64_t size, const CudaDeviceBuffer *context=nullptr) |
Simple memory buffer using un-managed pinned host memory when compiled with NVCC. Obviously this class is making explicit used of CUDA so replace it with your own memory allocator if you are not using CUDA.
|
inline |
|
delete |
Disallow copy-construction.
|
inlinenoexcept |
Move copy-constructor.
|
inline |
Destructor frees memory on both the host and device.
|
inline |
De-allocate all memory managed by this allocator and set all pointer to NULL.
|
inlinestatic |
|
inline |
|
inline |
|
inline |
Copy grid from the GPU/device to the CPU/host. If sync
is false the memory copy is asynchronous!
|
inline |
Copy grid from the CPU/host to the GPU/device. If sync
is false the memory copy is asynchronous!
|
inline |
Returns true if this allocator is empty, i.e. has no allocated memory.
|
inline |
|
delete |
Disallow copy assignment operation.
|
inlinenoexcept |
Move copy assignment operation.
|
inline |
Returns the size in bytes of the raw memory buffer managed by this allocator.