pub struct GpuIcpInput { /* private fields */ }Expand description
Explicitly uploaded source and target for reusable device ICP moments. CPU target-tree construction is external. Original source points remain immutable; every evaluation applies the absolute pose to those originals.
Implementations§
Source§impl GpuIcpInput
impl GpuIcpInput
Sourcepub fn upload(
runtime: &WgpuRuntime,
source: &[[f32; 3]],
target: &KdTree,
) -> SpatialResult<Self>
pub fn upload( runtime: &WgpuRuntime, source: &[[f32; 3]], target: &KdTree, ) -> SpatialResult<Self>
Uploads source XYZ and a nonempty finite target tree. Payload is 16S source bytes, 32T target bytes (tree order plus original order), and 32*M tree-node bytes. The combined normalization extent must have a normal finite f32 square; coincident source/target sets use scale 1. Derived zero frame anchors use +0 consistently; uploaded original XYZ bits, including signed zeros, are preserved. Nonzero anchors and scales retain their f64 preparation arithmetic.
Sourcepub fn upload_with_gpu_gather(
runtime: &WgpuRuntime,
source: &[[f32; 3]],
target: &KdTree,
) -> SpatialResult<Self>
pub fn upload_with_gpu_gather( runtime: &WgpuRuntime, source: &[[f32; 3]], target: &KdTree, ) -> SpatialResult<Self>
Explicitly gathers target tree points and original-order target queries
together on GPU. Host payload is 16S + 16T + 32M bytes, compared
with 16S + 32T + 32M for upload; device output bytes are 32T.
Source packing, CPU geometry validation/partitioning and node staging
remain. Integer copies preserve input bits, anchors, scale and ordering.
Two transient inputs add 16T GPU bytes beside owned outputs; host
target point/query packing vectors totaling 32*T payload bytes over
construction are removed. This is not a peak-memory reduction claim.
There is no readback or completion wait. Placement is explicit;
small inputs may be slower and existing device requirements apply.
Sourcepub const fn upload_transfers(&self) -> TransferStats
pub const fn upload_transfers(&self) -> TransferStats
Payload transferred during explicit input upload.
Sourcepub fn source_count(&self) -> u32
pub fn source_count(&self) -> u32
Original source point count.
Sourcepub fn moments_resident(
&self,
runtime: &WgpuRuntime,
transform: Isometry3<f32>,
max_distance: f32,
) -> SpatialResult<GpuIcpMoments>
pub fn moments_resident( &self, runtime: &WgpuRuntime, transform: Isometry3<f32>, max_distance: f32, ) -> SpatialResult<GpuIcpMoments>
Submits source transformation, bounded nearest search, compensated centroid/fitness and centered cross-covariance reductions in six passes. No payload copy/readback or host wait occurs. The fixed-size owned result can outlive inputs; consumers must check status before using its moments. GPU f32 transforms/reductions can differ from CPU f64 accumulation near match gates, degenerate geometry and convergence thresholds. No trimming or pose solve is performed here. Overflow invalidates ALL result payload.
Sourcepub fn trimmed_moments_resident(
&self,
runtime: &WgpuRuntime,
transform: Isometry3<f32>,
max_distance: f32,
fraction: f64,
) -> SpatialResult<GpuIcpTrimmedMoments>
pub fn trimmed_moments_resident( &self, runtime: &WgpuRuntime, transform: Isometry3<f32>, max_distance: f32, fraction: f64, ) -> SpatialResult<GpuIcpTrimmedMoments>
Submits stable GPU selection of the lowest-distance floor(fraction*N) gated pairs, breaking distance ties by original source index. Moments use retained pairs with DoubleSingle normalized arithmetic; fitness uses ALL gated pairs. Binary64 fraction multiplication/floor is emulated with integer limbs on the device. No match/point payload readback or host wait occurs. A fraction of one delegates to the canonical untrimmed kernels; no CPU fallback occurs.
Sourcepub fn trimmed_moments_resident_with_precision(
&self,
runtime: &WgpuRuntime,
transform: Isometry3<f32>,
max_distance: f32,
fraction: f64,
precision: GpuIcpTrimPrecision,
) -> SpatialResult<GpuIcpTrimmedMoments>
pub fn trimmed_moments_resident_with_precision( &self, runtime: &WgpuRuntime, transform: Isometry3<f32>, max_distance: f32, fraction: f64, precision: GpuIcpTrimPrecision, ) -> SpatialResult<GpuIcpTrimmedMoments>
Explicit choice of retained-moment arithmetic. DoubleSingle carries two f32 words through normalized offsets, division and products; f32 transforms/search stay unchanged. CompensatedF32 retains the earlier coordinate/product precision. Fraction one uses canonical ordinary moments for either choice. Transfers/ownership/status rules are identical.