Skip to main content

GpuMlsInput

Struct GpuMlsInput 

Source
pub struct GpuMlsInput { /* private fields */ }
Expand description

Explicitly uploaded MLS positions/tree/queries, reusable on one runtime. CPU tree construction is external; subsequent search and surface fitting run on GPU.

Implementations§

Source§

impl GpuMlsInput

Source

pub fn upload(runtime: &WgpuRuntime, tree: &KdTree) -> SpatialResult<Self>

Uploads a finite CPU tree and original-order queries. The query buffer is also the covariance position buffer: 32 bytes per point plus 32 per tree node, with no duplicate sample upload. Finite f32 extent squares required.

Source

pub fn upload_with_gpu_gather( runtime: &WgpuRuntime, tree: &KdTree, ) -> SpatialResult<Self>

Explicitly generates tree points and original-order query/position records in one integer GPU pass. Host payload is 16N + 32M bytes, compared with 32N + 32M for upload; device output bytes are 32N. No readback or completion wait. CPU partitioning, validation and node staging remain. Removes 32N host packing bytes, with 16*N transient GPU input bytes beside owned outputs. Small inputs may be slower; placement is explicit and existing MLS device requirements apply.

Source

pub const fn point_count(&self) -> u32

Original point count.

Source

pub const fn upload_transfers(&self) -> TransferStats

Payload explicitly transferred at construction (zero for empty input), including device output bytes for the GPU gather constructor.

Source

pub fn neighborhoods_resident( &self, runtime: &WgpuRuntime, radius: f32, capacity: u32, ) -> SpatialResult<GpuMlsNeighborhoods>

Builds reusable radius rows tied to this input, including self. Every match is counted; fitting rejects overflow. No readback or completion wait.

Source

pub fn smooth_resident( &self, runtime: &WgpuRuntime, neighbors: &GpuMlsNeighborhoods, polynomial_order: u8, min_neighbors: u32, ) -> SpatialResult<GpuMlsPositions>

Fits Gaussian-weighted local frames and constant/linear/quadratic surfaces on GPU, excluding the query itself after the minimum-support test. Sparse points stay unchanged; insufficient polynomial support/ill-conditioned solves use the plane on device. The normalized f32 solve uses a relative Cholesky rank threshold of 1e-6; CPU f64 uses Gaussian elimination with absolute pivot threshold 1e-12. Coordinates and fit/fallback decisions can differ near rank/eigenvalue degeneracy. Unsupported extent underflow is a numerical error. Three passes share one submission, without payload copies/host wait. Invalid rows or numerics zero ALL output; GPU consumers must check status.

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,