OpenVDB 14.0.0
Loading...
Searching...
No Matches
BufferTraits< cuda::Buffer< T, R > > Struct Template Reference

GridHandle support for the single-space cuda::Buffer: the buffer owns exactly one allocation, resident on the device, so the handle parses metadata through a device read and exposes only the device accessors. Requires byte-addressed storage. More...

#include <nanovdb/cuda/Buffer.h>

Static Public Attributes

static constexpr bool hasDeviceSingle
static constexpr bool hasHostSingle = cuda::is_host_accessible_resource<R>::value

Detailed Description

template<typename T, typename R>
struct nanovdb::BufferTraits< cuda::Buffer< T, R > >

GridHandle support for the single-space cuda::Buffer: the buffer owns exactly one allocation, resident on the device, so the handle parses metadata through a device read and exposes only the device accessors. Requires byte-addressed storage.

Note
This trait doubles as the definition of the single-space device-buffer concept: a buffer whose BufferTraits specialization sets hasDeviceSingle guarantees ElementType and ResourceType typedefs, data(), size() and size_bytes() (byte-addressed elements, enforced by the consumer), resource(), copy(), destroy(), and stream() when the resource is stream-ordered. Any consumer of hasDeviceSingle may rely on exactly this interface and nothing more; in particular, scratch allocates through resource() as a cuda::Buffer, so a conforming buffer never needs to be constructible by a consumer.

Member Data Documentation

◆ hasDeviceSingle

template<typename T, typename R>
bool hasDeviceSingle
staticconstexpr
Initial value:
Companion detection: is_device_accessible_resource<R>::value is true iff R declares static constexpr ...
Definition DeviceResource.h:142
Detection trait: is_host_accessible_resource<R>::value is true iff R declares static constexpr bool H...
Definition DeviceResource.h:130

◆ hasHostSingle

template<typename T, typename R>
bool hasHostSingle = cuda::is_host_accessible_resource<R>::value
staticconstexpr