Skip to main content

GpuIcpInput

Struct GpuIcpInput 

Source
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

Source

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.

Source

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.

Source

pub const fn upload_transfers(&self) -> TransferStats

Payload transferred during explicit input upload.

Source

pub fn source_count(&self) -> u32

Original source point count.

Source

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.

Source

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.

Source

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.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> Downcast<T> for T

§

fn downcast(&self) -> &T

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<T> Upcast<T> for T

§

fn upcast(&self) -> Option<&T>

§

impl<T> WasmNotSend for T
where T: Send,

§

impl<T> WasmNotSendSync for T
where T: WasmNotSend + WasmNotSync,

§

impl<T> WasmNotSync for T
where T: Sync,