Expand description
GPU runtime, device buffers, and kernel dispatch for SpatialRust.
Unsafe code is restricted to FFI and GPU interop boundaries in this crate.
Structs§
- Device
Buffer - Typed buffer allocated on a specific device.
- GpuNormal
- Per-point normal estimation output:
(nx, ny, nz, curvature). - GpuVoxel
KeyBuffers - GPU buffers for per-point positions and computed voxel keys.
- GpuVoxel
Segments - Voxel segment metadata kept on the GPU between sort/compact and reduce passes.
- Voxel
Approximate First GpuResult - GPU-resident approximate-first downsample result.
- Voxel
Centroid GpuResult - GPU-resident centroid downsample result.
- Voxel
Segments - Sorted voxel cell segments derived from per-point grid keys.
- Wgpu
Device - Portable GPU device backed by wgpu.
- Wgpu
Runtime - Headless wgpu runtime for compute-only workloads.
Constants§
- MULTI_
GATHE R2_ STORAGE_ BUFFERS - Minimum storage buffers required for the 2-channel gather kernel.
- MULTI_
GATHE R4_ STORAGE_ BUFFERS - Minimum storage buffers required for the 4-channel gather kernel.
Traits§
- GpuDevice
- Marker trait for GPU-capable devices.
Functions§
- build_
voxel_ segments - Builds sorted voxel segments from per-point
(ix, iy, iz)keys. - build_
voxel_ segments_ from_ positions_ gpu - Computes voxel keys on the GPU and builds sorted segments using GPU sorting.
- build_
voxel_ segments_ from_ positions_ gpu_ buffers - Builds GPU-resident voxel segments from positions without intermediate readbacks.
- build_
voxel_ segments_ gpu - Sorts per-point voxel keys on the GPU and compacts them into segments.
- build_
voxel_ segments_ gpu_ from_ keys_ buffer - Builds GPU-resident voxel segments from a GPU keys buffer.
- compact_
voxel_ segments_ from_ sorted - Compacts already-sorted voxel keys and point indices into segment metadata.
- compute_
voxel_ keys - Computes per-point voxel grid keys on the GPU.
- compute_
voxel_ keys_ gpu_ buffers - Uploads positions and computes per-point voxel keys, keeping data on the GPU.
- downsample_
voxel_ approximate_ first_ gpu - Runs the chained GPU approximate-first pipeline without intermediate readbacks.
- downsample_
voxel_ centroid_ gpu - Runs the chained GPU voxel centroid pipeline without intermediate key/segment readbacks.
- estimate_
normals_ gpu - Estimates per-point normals and curvature on the GPU.
- estimate_
normals_ grid_ gpu - Estimates per-point normals and curvature with a fully GPU radius neighbor search over a uniform grid.
- estimate_
plane_ covariances_ grid_ gpu - Estimates per-point plane-regularized covariances on the GPU via a uniform grid radius neighbor search.
- gather_
voxel_ first_ f32 - Gathers the first point’s
f32value within each voxel cell on the GPU. - gather_
voxel_ first_ f32_ gpu - Uploads
f32values and gathers the first point per GPU-resident voxel segment. - gather_
voxel_ first_ f32_ gpu_ buffers - Gathers the first point’s
f32value using GPU-resident segment buffers. - gather_
voxel_ first_ f32_ multi_ gpu - Gathers multiple
f32channels in one or more GPU dispatches. - gather_
voxel_ first_ xyz_ and_ average_ multi_ gpu - Gathers xyz and averages f32/u8 attribute channels with one GPU submit/readback.
- gather_
voxel_ first_ xyz_ and_ multi_ gpu - Gathers xyz and multiple f32/u8 attribute channels with one GPU submit/readback.
- gather_
voxel_ first_ xyz_ gpu_ buffers - Gathers xyz coordinates of the first point within each voxel cell on the GPU.
- reduce_
voxel_ average_ f32 - Averages per-point
f32values within each voxel cell on the GPU. - reduce_
voxel_ average_ f32_ gpu - Uploads
f32values and averages them within GPU-resident voxel segments. - reduce_
voxel_ average_ f32_ gpu_ buffers - Averages per-point
f32values using GPU-resident segment buffers. - reduce_
voxel_ average_ f32_ multi_ gpu - Uploads multiple
f32channels and averages them with one GPU submit/readback. - reduce_
voxel_ centroids_ xyz - Averages xyz positions within each voxel cell on the GPU.
- reduce_
voxel_ centroids_ xyz_ and_ average_ multi_ gpu - Averages xyz and multiple f32/u8 attribute channels with one GPU submit/readback.
- reduce_
voxel_ centroids_ xyz_ and_ gather_ first_ multi_ gpu - Averages xyz and gathers the first f32/u8 attribute value per voxel with one readback.
- reduce_
voxel_ centroids_ xyz_ gpu_ buffers - Averages xyz positions using GPU-resident buffers.
Type Aliases§
- GpuCovariance
- Per-point plane-regularized covariance as 6 unique elements:
[c00, c11, c22, c01, c02, c12].