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§

DeviceBuffer
Typed buffer allocated on a specific device.
GpuNormal
Per-point normal estimation output: (nx, ny, nz, curvature).
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.
WgpuDevice
Portable GPU device backed by wgpu.
WgpuRuntime
Headless wgpu runtime for compute-only workloads.

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§

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 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.
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.

Type Aliases§

GpuCovariance
Per-point plane-regularized covariance as 6 unique elements: [c00, c11, c22, c01, c02, c12].