Skip to main content

Crate spatialrust_gpu

Crate spatialrust_gpu 

Source
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§

AoSoAAttributeReduction
CPU-visible interleaved records produced by GPU voxel aggregation.
AoSoAVoxelCentroidResult
Centroid result from the GPU-resident AoSoA voxel pipeline.
DeviceBuffer
Typed buffer allocated on a specific device.
GpuAiTensor
Device-resident planar f32 tensor with explicit optional readback.
GpuAoSoAttributeChunk
GPU storage buffer for one interleaved attribute chunk and its layout.
GpuAoSoNormals
GPU-resident (nx, ny, nz, curvature) output for AoSoA positions.
GpuAoSoRadiusGrid
Sparse GPU-resident uniform grid built directly from AoSoA positions.
GpuAoSoXyzBuffer
GPU storage buffer containing contiguous interleaved XYZ positions.
GpuAoSoXyzChunk
GPU storage buffer holding one interleaved XYZ chunk.
GpuBufferPool
Reusable GPU storage buffers keyed by byte length.
GpuExecutionReceipt
Transfer and logical-stage receipt for one GPU frame.
GpuImage
GPU-resident packed image backed by an rgba8uint 2D texture.
GpuImageReceipt
Transfer accounting for GPU image uploads, device copies, and readbacks.
GpuNormal
Per-point normal estimation output: (nx, ny, nz, curvature).
GpuPlaneScore
GPU score for one RANSAC plane hypothesis.
GpuSpatialFrame
Owned GPU-resident point frame with explicit schema and device identity.
GpuVisionChainOptions
Configuration for the resident resize-to-AI chain.
GpuVoxelKeyBuffers
GPU buffers for per-point positions and computed voxel keys.
GpuVoxelSegments
Voxel segment metadata kept on the GPU between sort/compact and reduce passes.
VoxelApproximateFirstGpuResult
GPU-resident approximate-first downsample result.
VoxelCentroidGpuResult
GPU-resident centroid downsample result.
VoxelSegments
Sorted voxel cell segments derived from per-point grid keys.
WgpuAdapterInfo
Stable, serializable-friendly identity for the selected wgpu adapter.
WgpuDevice
Portable GPU device backed by wgpu.
WgpuRuntime
Headless wgpu runtime for compute-only workloads.

Enums§

AoSoAAttributeAggregation
Aggregation policy for interleaved AoSoA voxel attributes.
GpuFrameCapability
GPU frame capabilities available to downstream algorithms.
GpuImageBorder
Border extrapolation for GPU image filters.
GpuMorphology
Single-channel morphology operation executed on a GPU texture.
WgpuPowerPreference
Adapter power preference used when creating a headless wgpu runtime.

Constants§

MULTI_GATHER2_STORAGE_BUFFERS
Minimum storage buffers required for the 2-channel gather kernel.
MULTI_GATHER4_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 source into 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 f32 value within each voxel cell on the GPU.
gather_voxel_first_f32_gpu
Uploads f32 values and gathers the first point per GPU-resident voxel segment.
gather_voxel_first_f32_gpu_buffers
Gathers the first point’s f32 value using GPU-resident segment buffers.
gather_voxel_first_f32_multi_gpu
Gathers multiple f32 channels 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 f32 storage.
reduce_voxel_attributes_aoso_chunks
Aggregates uploaded interleaved records using global GPU voxel segments.
reduce_voxel_average_f32
Averages per-point f32 values within each voxel cell on the GPU.
reduce_voxel_average_f32_gpu
Uploads f32 values and averages them within GPU-resident voxel segments.
reduce_voxel_average_f32_gpu_buffers
Averages per-point f32 values using GPU-resident segment buffers.
reduce_voxel_average_f32_multi_gpu
Uploads multiple f32 channels 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 GpuImage to a gray GpuImage using 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].