OpenVDB 13.1.0
Loading...
Searching...
No Matches
nanovdb::detail Namespace Reference

Functions

template<typename BufferT>
BufferT createHostStorage (uint64_t bytes, const BufferT &pool)
 Allocates bytes of host-readable storage for a GridHandle: through BufferT::create for buffers that provide it, and through pool's resource for a host-accessible single-space buffer (e.g. a pinned-resource cuda::Buffer). The braced third argument selects the uninitialized-storage constructor without naming its tag type, so this header stays CUDA-free.
void parseHostGridChain (const GridData *head, uint64_t bytes, std::vector< GridHandleMetaData > &meta)
 Validates the grid chain in bytes of host-readable memory headed by head and fills meta with one entry per grid: every header must be valid, carry its expected index and the chain's total count, and fit inside the buffer, so a truncated buffer or a forged header is rejected before its metadata is trusted. This is the host counterpart of the device-side chain parse, and it is what makes a handle's metadata safe to adopt without re-validation (cuda::copyTo).

Function Documentation

◆ createHostStorage()

template<typename BufferT>
BufferT createHostStorage ( uint64_t bytes,
const BufferT & pool )
inline

Allocates bytes of host-readable storage for a GridHandle: through BufferT::create for buffers that provide it, and through pool's resource for a host-accessible single-space buffer (e.g. a pinned-resource cuda::Buffer). The braced third argument selects the uninitialized-storage constructor without naming its tag type, so this header stays CUDA-free.

◆ parseHostGridChain()

void parseHostGridChain ( const GridData * head,
uint64_t bytes,
std::vector< GridHandleMetaData > & meta )
inline

Validates the grid chain in bytes of host-readable memory headed by head and fills meta with one entry per grid: every header must be valid, carry its expected index and the chain's total count, and fit inside the buffer, so a truncated buffer or a forged header is rejected before its metadata is trusted. This is the host counterpart of the device-side chain parse, and it is what makes a handle's metadata safe to adopt without re-validation (cuda::copyTo).