CPU counterpart of tools::cuda::VoxelBlockManager. Provides host-side decode of the inverse maps (sequential index -> leaf + voxel offset) for a single voxel block. The implementation is single-threaded per block and SIMD-accelerated (via util::shuffleDownMask and util::buildMaskPrefixSums); the caller is responsible for parallelism across blocks (e.g. OpenMP or nanovdb::util::forEach).
More...
#include <nanovdb/tools/VoxelBlockManager.h>
|
| template<class BuildT> |
| static util::enable_if< BuildTraits< BuildT >::is_index, void >::type | decodeInverseMaps (const NanoGrid< BuildT > *grid, const uint32_t firstLeafID, const uint64_t *jumpMap, const uint64_t blockFirstOffset, uint32_t *leafIndex, uint16_t *voxelOffset) |
| | Decode the inverse maps for a single voxel block on the host.
|
|
| static constexpr int | BlockWidth |
| static constexpr int | JumpMapLength |
| | number of uint64_t words per block in the jumpMap
|
| static constexpr uint32_t | UnusedLeafIndex |
| | Sentinel written to leafIndex slots with no active voxel in this block.
|
| static constexpr uint16_t | UnusedVoxelOffset |
| | Sentinel written to voxelOffset slots with no active voxel in this block.
|
template<int Log2BlockWidth>
struct nanovdb::tools::VoxelBlockManager< Log2BlockWidth >
CPU counterpart of tools::cuda::VoxelBlockManager. Provides host-side decode of the inverse maps (sequential index -> leaf + voxel offset) for a single voxel block. The implementation is single-threaded per block and SIMD-accelerated (via util::shuffleDownMask and util::buildMaskPrefixSums); the caller is responsible for parallelism across blocks (e.g. OpenMP or nanovdb::util::forEach).
◆ Base
template<int Log2BlockWidth>
◆ decodeInverseMaps()
template<int Log2BlockWidth>
template<class BuildT>
| util::enable_if< BuildTraits< BuildT >::is_index, void >::type decodeInverseMaps |
( |
const NanoGrid< BuildT > * | grid, |
|
|
const uint32_t | firstLeafID, |
|
|
const uint64_t * | jumpMap, |
|
|
const uint64_t | blockFirstOffset, |
|
|
uint32_t * | leafIndex, |
|
|
uint16_t * | voxelOffset ) |
|
inlinestatic |
Decode the inverse maps for a single voxel block on the host.
Given the VBM metadata for one block (firstLeafID and the block's slice of the jumpMap) and the block's base sequential offset, fills leafIndex[] and voxelOffset[] so that for each position p in [0, BlockWidth):
- leafIndex[p] = index of the leaf node containing sequential voxel (blockFirstOffset + p), or UnusedLeafIndex if that index is beyond the last active voxel.
- voxelOffset[p] = local (0..511) offset of that voxel within its leaf, or UnusedVoxelOffset.
The CPU analogue of the CUDA decodeInverseMaps. Single-threaded per block; SIMD is used internally. The caller is responsible for parallelism across blocks.
- Template Parameters
-
| BuildT | Build type of the grid (must be an index type) |
- Parameters
-
| grid | Host-accessible OnIndex grid |
| firstLeafID | Index of the first leaf overlapping this block |
| jumpMap | Pointer to the JumpMapLength words for this block |
| blockFirstOffset | Sequential index of the first voxel in this block |
| leafIndex | Output array of length BlockWidth |
| voxelOffset | Output array of length BlockWidth |
◆ BlockWidth
template<int Log2BlockWidth>
◆ JumpMapLength
template<int Log2BlockWidth>
number of uint64_t words per block in the jumpMap
◆ UnusedLeafIndex
template<int Log2BlockWidth>
Sentinel written to leafIndex slots with no active voxel in this block.
◆ UnusedVoxelOffset
template<int Log2BlockWidth>
| uint16_t UnusedVoxelOffset |
|
staticconstexpr |
Sentinel written to voxelOffset slots with no active voxel in this block.