|
| template<typename T = BufferT, typename util::enable_if< BufferTraits< T >::hasDeviceDual, int >::type = 0> |
| | GridHandle (T &&buffer) |
| | Move constructor from a dual host-device buffer.
|
| template<typename T = BufferT, typename util::disable_if< BufferTraits< T >::hasDeviceDual||BufferHasDeviceSingle< T >::value, int >::type = 0> |
| | GridHandle (T &&buffer) |
| | Move constructor from a host buffer.
|
| template<typename T = BufferT, typename util::enable_if< BufferHasDeviceSingle< T >::value, int >::type = 0, typename = void> |
| | GridHandle (T &&buffer) |
| | Move constructor from a single-space device buffer: the grid metadata is read through the device on the buffer's stream.
|
| | GridHandle ()=default |
| | Constructs an empty GridHandle.
|
| | GridHandle (const GridHandle &)=delete |
| | Disallow copy-construction.
|
| | GridHandle (GridHandle &&other) noexcept |
| | Move copy-constructor.
|
| void | reset () |
| | clear this GridHandle to an empty handle
|
| GridHandle & | operator= (const GridHandle &)=delete |
| | Disallow copy assignment operation.
|
| GridHandle & | operator= (GridHandle &&other) noexcept |
| | Move copy assignment operation.
|
| template<typename OtherBufferT = HostBuffer> |
| GridHandle< OtherBufferT > | copy (const OtherBufferT &buffer) const |
| | Performs a deep copy of the GridHandle, possibly templated on a different buffer type.
|
| template<typename OtherBufferT = HostBuffer> |
| GridHandle< OtherBufferT > | copy () const |
| | Deep copy without a pool argument. The single-space path allocates through the source buffer's resource and never constructs a pool buffer, so it works for buffers that are not default-constructible, e.g. over a ResourceRef. The host path default-constructs the pool argument, so it requires a default-constructible OtherBufferT.
|
| BufferT & | buffer () |
| | Return a reference to the buffer.
|
| const BufferT & | buffer () const |
| | Return a const reference to the buffer.
|
| template<typename U = BufferT, typename util::disable_if< BufferIsDeviceOnly< U >::value, int >::type = 0> |
| void * | data () |
| | Returns a pointer to the host data; not available for a single-space device buffer, which has no host-readable bytes.
|
| template<typename U = BufferT, typename util::disable_if< BufferIsDeviceOnly< U >::value, int >::type = 0> |
| const void * | data () const |
| template<typename U = BufferT> |
| util::enable_if< BufferTraits< U >::hasDeviceDual, constvoid * >::type | deviceData () const |
| template<typename U = BufferT> |
| util::enable_if< BufferTraits< U >::hasDeviceDual, constvoid * >::type | deviceData (int device) const |
| template<typename U = BufferT> |
| util::enable_if< BufferTraits< U >::hasDeviceDual, void * >::type | deviceData () |
| template<typename U = BufferT> |
| util::enable_if< BufferTraits< U >::hasDeviceDual, void * >::type | deviceData (int device) |
| template<typename U = BufferT> |
| util::enable_if< BufferHasDeviceSingle< U >::value, constvoid * >::type | deviceData () const |
| | For a single-space buffer the device data is the buffer itself.
|
| template<typename U = BufferT> |
| util::enable_if< BufferHasDeviceSingle< U >::value, void * >::type | deviceData () |
| uint64_t | size () const |
| | Returns the size in bytes of the raw memory buffer managed by this GridHandle.
|
| uint64_t | bufferSize () const |
| bool | empty () const |
| | Return true if this handle is empty, i.e. has no allocated memory.
|
| bool | isEmpty () const |
| | operator bool () const |
| | Return true if this handle is not empty, i.e. contains at least one grid.
|
| template<typename ValueT, typename U = BufferT, typename util::disable_if< BufferIsDeviceOnly< U >::value, int >::type = 0> |
| const NanoGrid< ValueT > * | grid (uint32_t n=0) const |
| | Returns a const host pointer to the n'th NanoVDB grid encoded in this GridHandle.
|
| template<typename ValueT, typename U = BufferT, typename util::disable_if< BufferIsDeviceOnly< U >::value, int >::type = 0> |
| NanoGrid< ValueT > * | grid (uint32_t n=0) |
| | Returns a host pointer to the n'th NanoVDB grid encoded in this GridHandle.
|
| template<typename ValueT, typename U = BufferT> |
| util::enable_if< BufferTraits< U >::hasDeviceDual, constNanoGrid< ValueT > * >::type | deviceGrid (uint32_t n=0) const |
| | Return a const pointer to the n'th grid encoded in this GridHandle on the device, e.g. GPU.
|
| template<typename ValueT, typename U = BufferT> |
| util::enable_if< BufferTraits< U >::hasDeviceDual, NanoGrid< ValueT > * >::type | deviceGrid (uint32_t n=0) |
| | Return a const pointer to the n'th grid encoded in this GridHandle on the device, e.g. GPU.
|
| template<typename ValueT, typename U = BufferT> |
| util::enable_if< BufferHasDeviceSingle< U >::value, constNanoGrid< ValueT > * >::type | deviceGrid (uint32_t n=0) const |
| | Return a pointer to the n'th grid of a single-space device buffer.
|
| template<typename ValueT, typename U = BufferT> |
| util::enable_if< BufferHasDeviceSingle< U >::value, NanoGrid< ValueT > * >::type | deviceGrid (uint32_t n=0) |
| template<typename U = BufferT> |
| util::enable_if< BufferTraits< U >::hasDeviceDual, void >::type | deviceUpload (void *stream, bool sync=true) |
| | Upload the grid to the device, e.g. from CPU to GPU.
|
| template<typename U = BufferT> |
| util::enable_if< BufferTraits< U >::hasDeviceDual, void >::type | deviceUpload (int device=0, void *stream=nullptr, bool sync=true) |
| | Upload the host buffer to a specific device buffer. It device buffer doesn't exist it's created first.
|
| template<typename U = BufferT> |
| util::enable_if< BufferTraits< U >::hasDeviceDual, void >::type | deviceDownload (void *stream, bool sync=true) |
| | Download the grid to from the device, e.g. from GPU to CPU.
|
| template<typename U = BufferT> |
| util::enable_if< BufferTraits< U >::hasDeviceDual, void >::type | deviceDownload (int device=0, void *stream=nullptr, bool sync=true) |
| bool | isPadded () const |
| | Check if the buffer is this handle has any padding, i.e. if the buffer is larger than the combined size of all its grids.
|
| uint32_t | gridCount () const |
| | Return the total number of grids contained in this buffer.
|
| uint64_t | gridSize (uint32_t n=0) const |
| | Return the grid size of the n'th grid in this GridHandle.
|
| uint64_t | totalGridSize () const |
| | compute the total sum of memory footprints of all the grids in this buffer
|
| uint64_t | freeSize () const |
| | compute the size of unused storage in this buffer
|
| bool | isFull () const |
| | Test if this buffer has any unused storage left, i.e. memory not occupied by grids.
|
| GridType | gridType (uint32_t n=0) const |
| | Return the GridType of the n'th grid in this GridHandle.
|
| template<typename U = BufferT, typename util::disable_if< BufferIsDeviceOnly< U >::value, int >::type = 0> |
| const GridData * | gridData (uint32_t n=0) const |
| | Access to the GridData of the n'th grid in the current handle.
|
| template<typename U = BufferT, typename util::disable_if< BufferIsDeviceOnly< U >::value, int >::type = 0> |
| const GridMetaData * | gridMetaData (uint32_t n=0) const |
| | Returns a const point to the n'th grid meta data.
|
| void | write (std::ostream &os, uint32_t n) const |
| | Write a specific grid in this buffer to an output stream.
|
| void | write (std::ostream &os) const |
| | Write the entire grid buffer to an output stream.
|
| void | write (const std::string &fileName) const |
| | Write this entire grid buffer to a file.
|
| void | write (const std::string &fileName, uint32_t n) const |
| | Write a specific grid to file.
|
| void | read (std::istream &is, const BufferT &pool=BufferT()) |
| | Read an entire raw grid buffer from an input stream.
|
| void | read (std::istream &is, uint32_t n, const BufferT &pool=BufferT()) |
| | Read a specific grid from an input stream containing a raw grid buffer.
|
| void | read (std::istream &is, const std::string &gridName, const BufferT &pool=BufferT()) |
| | Read a specific grid from an input stream containing a raw grid buffer.
|
| void | read (const std::string &fileName, const BufferT &pool=BufferT()) |
| | Read a raw grid buffer from a file.
|
| void | read (const std::string &fileName, uint32_t n, const BufferT &pool=BufferT()) |
| | Read a specific grid from a file containing a raw grid buffer.
|
| void | read (const std::string &fileName, const std::string &gridName, const BufferT &pool=BufferT()) |
| | Read a specific grid from a file containing a raw grid buffer.
|
template<typename BufferT = HostBuffer>
class nanovdb::GridHandle< BufferT >
This class serves to manage a buffer containing one or more NanoVDB Grids.
- Note
- It is important to note that this class does NOT depend on OpenVDB.