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
impl GpuMlsInput
Sourcepub fn upload(runtime: &WgpuRuntime, tree: &KdTree) -> SpatialResult<Self>
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.
Sourcepub fn upload_with_gpu_gather(
runtime: &WgpuRuntime,
tree: &KdTree,
) -> SpatialResult<Self>
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.
Sourcepub const fn point_count(&self) -> u32
pub const fn point_count(&self) -> u32
Original point count.
Sourcepub const fn upload_transfers(&self) -> TransferStats
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.
Sourcepub fn neighborhoods_resident(
&self,
runtime: &WgpuRuntime,
radius: f32,
capacity: u32,
) -> SpatialResult<GpuMlsNeighborhoods>
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.
Sourcepub fn smooth_resident(
&self,
runtime: &WgpuRuntime,
neighbors: &GpuMlsNeighborhoods,
polynomial_order: u8,
min_neighbors: u32,
) -> SpatialResult<GpuMlsPositions>
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.