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§
- AoSoA
Attribute Reduction - CPU-visible interleaved records produced by GPU voxel aggregation.
- AoSoA
Voxel Centroid Result - Centroid result from the GPU-resident AoSoA voxel pipeline.
- Device
Buffer - Typed buffer allocated on a specific device.
- GpuAi
Tensor - Device-resident planar
f32tensor with explicit optional readback. - GpuAo
SoAttribute Chunk - GPU storage buffer for one interleaved attribute chunk and its layout.
- GpuAo
SoNormals - GPU-resident
(nx, ny, nz, curvature)output for AoSoA positions. - GpuAo
SoRadius Grid - Sparse GPU-resident uniform grid built directly from AoSoA positions.
- GpuAo
SoXyz Buffer - GPU storage buffer containing contiguous interleaved XYZ positions.
- GpuAo
SoXyz Chunk - GPU storage buffer holding one interleaved XYZ chunk.
- GpuBuffer
Pool - Reusable GPU storage buffers keyed by byte length.
- GpuExecution
Receipt - Transfer and logical-stage receipt for one GPU frame.
- GpuImage
- GPU-resident packed image backed by an
rgba8uint2D texture. - GpuImage
Receipt - Transfer accounting for GPU image uploads, device copies, and readbacks.
- GpuNormal
- Per-point normal estimation output:
(nx, ny, nz, curvature). - GpuPlane
Score - GPU score for one RANSAC plane hypothesis.
- GpuSpatial
Frame - Owned GPU-resident point frame with explicit schema and device identity.
- GpuVision
Chain Options - Configuration for the resident resize-to-AI chain.
- 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
Adapter Info - Stable, serializable-friendly identity for the selected wgpu adapter.
- Wgpu
Device - Portable GPU device backed by wgpu.
- Wgpu
Runtime - Headless wgpu runtime for compute-only workloads.
Enums§
- AoSoA
Attribute Aggregation - Aggregation policy for interleaved AoSoA voxel attributes.
- GpuFrame
Capability - GPU frame capabilities available to downstream algorithms.
- GpuImage
Border - Border extrapolation for GPU image filters.
- GpuMorphology
- Single-channel morphology operation executed on a GPU texture.
- Wgpu
Power Preference - Adapter power preference used when creating a headless wgpu runtime.
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§
- box_
blur_ gpu - Applies a square/rectangular mean box blur to a single-channel
GpuImage. - build_
radius_ grid_ aoso_ gpu - Builds a sparse uniform radius grid directly from retained AoSoA positions.
- 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_ aoso_ chunks - Computes voxel keys directly from uploaded interleaved XYZ chunks.
- compute_
voxel_ keys_ gpu_ buffers - Uploads positions and computes per-point voxel keys, keeping data on the GPU.
- copy_
gpu_ image - Copies
sourceinto a new GPU image without host transfers. - downsample_
voxel_ approximate_ first_ gpu - Runs the chained GPU approximate-first pipeline without intermediate readbacks.
- downsample_
voxel_ centroid_ aoso_ chunks - Runs global voxel centroid downsampling from uploaded AoSoA chunks.
- downsample_
voxel_ centroid_ gpu - Runs the chained GPU voxel centroid pipeline without intermediate key/segment readbacks.
- estimate_
normals_ aoso_ gpu - Estimates normals directly from a retained interleaved XYZ GPU buffer.
- 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_
normals_ radius_ grid_ aoso_ gpu - Estimates radius normals directly from a GPU-resident sparse AoSoA grid.
- estimate_
plane_ covariances_ grid_ gpu - Estimates per-point plane-regularized covariances on the GPU via a uniform grid radius neighbor search.
- euclidean_
cluster_ roots_ gpu - Connected-component roots via uniform-grid union-find. Computes Euclidean component roots using GPU sparse-grid construction.
- euclidean_
cluster_ roots_ gpu_ with_ receipt - Runs the GPU sparse-grid stage and returns its transfer accounting together with deterministic host-side component roots.
- euclidean_
cluster_ roots_ grid - Connected-component roots via uniform-grid union-find (minimum index per component).
- 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.
- morphology_
gpu - Applies rectangular erosion or dilation without leaving device memory.
- pack_
ai_ chw_ gpu - Packs a resident image into normalized planar CHW
f32storage. - reduce_
voxel_ attributes_ aoso_ chunks - Aggregates uploaded interleaved records using global GPU voxel segments.
- 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.
- resize_
nearest_ gpu - Resizes a device image with nearest-neighbor sampling without host transfer.
- rgb_
to_ gray_ gpu - Converts an RGB
GpuImageto a grayGpuImageusing BT.601 fixed-point luma. - run_
aoso_ voxel_ normal_ frame - Uploads a tensor and chains global voxel partitioning and radius normals.
- run_
gpu_ vision_ chain - Runs resize → gray → blur → Sobel → morphology → planar AI packing.
- score_
ransac_ plane_ hypotheses_ gpu - Scores RANSAC plane hypotheses in parallel on the GPU.
- sobel_
gpu - Computes clamped L1 Sobel magnitude on a single-channel device image.
- uniform_
grid_ fits - Returns whether a uniform grid with the given cell size fits within the cell cap.
- upload_
spatial_ tensor_ attribute_ chunks - Packs and uploads every tensor chunk with an explicit attribute layout.
- upload_
spatial_ tensor_ xyz_ chunks - Packs and uploads every chunk in a
SpatialTensor.
Type Aliases§
- GpuCovariance
- Per-point plane-regularized covariance as 6 unique elements:
[c00, c11, c22, c01, c02, c12].