pub struct GpuGicpInput { /* private fields */ }Expand description
Reusable explicitly uploaded positions/tree and SPD covariances for GICP. Covariances are explicitly uploaded or prepared on GPU. Position storage shares the ICP input representation; every evaluation transforms immutable original source points.
Implementations§
Source§impl GpuGicpInput
impl GpuGicpInput
Sourcepub fn upload_with_gpu_covariances(
runtime: &WgpuRuntime,
source: &KdTree,
target: &KdTree,
k: u32,
epsilon: f32,
) -> SpatialResult<Self>
pub fn upload_with_gpu_covariances( runtime: &WgpuRuntime, source: &KdTree, target: &KdTree, k: u32, epsilon: f32, ) -> SpatialResult<Self>
Explicitly uploads finite source/target trees and original-order positions, then computes both k-NN plane-regularized covariances entirely on GPU. Query positions and target tree are shared with the registration passes. Payload upload is 32*(S+T) + 32*(source_nodes+target_nodes) bytes; no neighborhoods/covariances are downloaded or re-uploaded. Three submissions prepare bounded neighborhoods, covariance eigenvectors and global status, without a host wait. Prepared covariance rows remain owned by this input. Both trees must be nonempty; k=3..=64 and epsilon=1e-4..=1 are supported. Eigenvectors use centered/scaled compensated f32 covariance and the CPU 32-step/physical 1e-12 Jacobi stopping convention. f32 arithmetic, ties, repeated eigenvalues and CPU raw-product rounding can change covariances. Invalid preparation makes ALL subsequent equation downloads fail (status bit 16); no CPU fallback occurs. CPU tree construction is external.
Sourcepub fn upload_with_gpu_radius_covariances(
runtime: &WgpuRuntime,
source: &KdTree,
target: &KdTree,
radius: f32,
capacity: u32,
epsilon: f32,
) -> SpatialResult<Self>
pub fn upload_with_gpu_radius_covariances( runtime: &WgpuRuntime, source: &KdTree, target: &KdTree, radius: f32, capacity: u32, epsilon: f32, ) -> SpatialResult<Self>
Uploads original positions/trees and prepares complete inclusive radius
neighborhoods and plane covariances on GPU, without payload readback.
capacity is a positive per-point bound, including self and duplicates.
Overflow invalidates both covariance sets and every equation download;
rows are never silently truncated. Radius must be finite/positive with
a normal f32 square; epsilon must be in 1e-4..=1.
Fewer than three neighbors use epsilon*I, as in the existing grid route.
Other rows use centered/scaled compensated sums and 32 max-pivot Jacobi
steps with physical 1e-20 stopping on the unnormalized central sum.
f32 arithmetic, traversal order and repeated eigenvalues can differ
from the legacy grid’s raw means and 16 three-pivot sweeps.
Transfers, ownership and CPU solve boundaries match the k-NN method.
Source§impl GpuGicpInput
impl GpuGicpInput
Sourcepub fn upload_with_gpu_grid_covariances(
runtime: &WgpuRuntime,
source: (&[f32], &[f32], &[f32]),
target: &KdTree,
radius: f32,
capacity: u32,
epsilon: f32,
) -> SpatialResult<Self>
pub fn upload_with_gpu_grid_covariances( runtime: &WgpuRuntime, source: (&[f32], &[f32], &[f32]), target: &KdTree, radius: f32, capacity: u32, epsilon: f32, ) -> SpatialResult<Self>
Uploads original positions/target tree and prepares radius covariances directly on GPU using CPU-built counting-sort grids. No source KD-tree, neighborhood rows or covariance readback/re-upload is needed. Capacity includes self/duplicates; overflow invalidates both sets/all equations. Dense grids must fit the existing cell/device limits; there is no automatic switch to the bounded-neighborhood or CPU paths. The existing grid’s raw f32 means, central sums and 16 three-pivot sweeps are retained, including sparse epsilonI. Numerical failure rejects. Requires nonempty finite equal-length source axes/target tree, positive capacity/radius with normal finite f32 square, epsilon=1e-4..=1, and supported reduction limits. Each dataset is bounded to 2^24 points for exact f32 support counts. CPU grid/tree preparation remains explicit. H2D is 20S+36T+32target_nodes+4*(source_cells+target_cells+2); there is no preparation D2H. Prepared inputs own covariance storage.
Source§impl GpuGicpInput
impl GpuGicpInput
Sourcepub fn upload(
runtime: &WgpuRuntime,
source: &[[f32; 3]],
source_covariances: &[[f32; 6]],
target: &KdTree,
target_covariances: &[[f32; 6]],
) -> SpatialResult<Self>
pub fn upload( runtime: &WgpuRuntime, source: &[[f32; 3]], source_covariances: &[[f32; 6]], target: &KdTree, target_covariances: &[[f32; 6]], ) -> SpatialResult<Self>
Uploads positions/tree plus original-order covariance rows packed as [xx,yy,zz,xy,xz,yz]. Covariances must be finite SPD in their f32 form. H2D payload is 48S + 64T + 32*M bytes; covariance rows are padded to 32 bytes. A normal finite target-inverse trace scale is required. Native large covariance batches use bounded CPU staging workers; each row retains its f64 SPD validation and original upload order. Small batches and WASM prepare serially, before any device upload.
Sourcepub fn upload_with_gpu_gather(
runtime: &WgpuRuntime,
source: &[[f32; 3]],
source_covariances: &[[f32; 6]],
target: &KdTree,
target_covariances: &[[f32; 6]],
) -> SpatialResult<Self>
pub fn upload_with_gpu_gather( runtime: &WgpuRuntime, source: &[[f32; 3]], source_covariances: &[[f32; 6]], target: &KdTree, target_covariances: &[[f32; 6]], ) -> SpatialResult<Self>
Explicitly uses shared GPU gathering for target tree points/queries.
Host payload is 48S + 48T + 32M bytes, compared with 48S + 64T + 32M
for upload; device output bytes are 32T. Covariance validation/packing and weight scale are unchanged.
Source/geometry preparation remains on CPU. Two transient inputs add
16T GPU bytes; host target packing totaling 32*T payload bytes over
construction is removed. No readback or completion wait is added.
Placement is explicit; small inputs may be slower and existing device
requirements apply. See GpuIcpInput::upload_with_gpu_gather.
Sourcepub const fn upload_transfers(&self) -> TransferStats
pub const fn upload_transfers(&self) -> TransferStats
Payload copied at construction; GPU-generated covariances add no H2D.
Sourcepub fn source_count(&self) -> u32
pub fn source_count(&self) -> u32
Original source count.
Sourcepub fn equations_resident(
&self,
runtime: &WgpuRuntime,
transform: Isometry3<f32>,
max_distance: f32,
) -> SpatialResult<GpuGicpNormalEquations>
pub fn equations_resident( &self, runtime: &WgpuRuntime, transform: Isometry3<f32>, max_distance: f32, ) -> SpatialResult<GpuGicpNormalEquations>
Transforms originals, runs unbounded nearest matching followed by the finite inclusive gate, prepares rotated covariance inverse weights and reduces centered/scaled normal equations and Euclidean fitness. Five passes share one submission; no payload transfer or host wait occurs. After matching, transformed queries become centered position/count rows. Private scratch is 72S + 240min(ceil(S/64),256) bytes for nonempty S. GPU Cholesky pivots <=1e-6 of covariance scale reject the whole result, rather than silently dropping ill-conditioned pairs. f32 arithmetic can change weights, matches, solutions and stopping relative to CPU f64.