Synchronous device memory resource backed by cudaMalloc/cudaFree. Models only the Resource concept: it never touches stream-ordered allocation, so it works on devices without memory-pool support (cudaDevAttrMemoryPoolsSupported == 0), where DeviceResource's cudaMallocAsync path fails by design. Pair with AsyncFromSync to drive the stream-ordered builders on such a device.
More...
#include <nanovdb/cuda/DeviceResource.h>
|
| void * | allocate (size_t bytes, size_t) |
| | Allocates bytes with cudaMalloc; valid on every stream when this returns. A zero request returns nullptr.
|
| void | deallocate (void *p, size_t, size_t) |
| | Frees p with cudaFree; the caller guarantees that device work touching the memory has completed.
|
Synchronous device memory resource backed by cudaMalloc/cudaFree. Models only the Resource concept: it never touches stream-ordered allocation, so it works on devices without memory-pool support (cudaDevAttrMemoryPoolsSupported == 0), where DeviceResource's cudaMallocAsync path fails by design. Pair with AsyncFromSync to drive the stream-ordered builders on such a device.
◆ allocate()
| void * allocate |
( |
size_t | bytes, |
|
|
size_t | ) |
|
inline |
Allocates bytes with cudaMalloc; valid on every stream when this returns. A zero request returns nullptr.
◆ deallocate()
| void deallocate |
( |
void * | p, |
|
|
size_t | , |
|
|
size_t | ) |
|
inline |
Frees p with cudaFree; the caller guarantees that device work touching the memory has completed.
◆ DEFAULT_ALIGNMENT
| size_t DEFAULT_ALIGNMENT = 256 |
|
staticconstexpr |