pub struct GpuFpfhInput { /* private fields */ }Expand description
Explicitly uploaded FPFH positions/unit normals and their GPU KD-tree/query batch. Original point order is retained; CPU tree construction is external. All subsequent neighborhood and descriptor computation stays on GPU.
Implementations§
Source§impl GpuFpfhInput
impl GpuFpfhInput
Sourcepub fn upload(
runtime: &WgpuRuntime,
tree: &KdTree,
normals: &[[f32; 3]],
) -> SpatialResult<Self>
pub fn upload( runtime: &WgpuRuntime, tree: &KdTree, normals: &[[f32; 3]], ) -> SpatialResult<Self>
Uploads a CPU KD-tree and matching original-order finite unit normals. Payload is 64 bytes per point plus 32 per tree node (samples, original queries and KD-tree points/nodes). No readback is performed. Coordinate extents must have a finite f32 squared length, as in CPU FPFH.
Sourcepub fn upload_with_gpu_gather(
runtime: &WgpuRuntime,
tree: &KdTree,
normals: &[[f32; 3]],
) -> SpatialResult<Self>
pub fn upload_with_gpu_gather( runtime: &WgpuRuntime, tree: &KdTree, normals: &[[f32; 3]], ) -> SpatialResult<Self>
Explicitly generates tree points, original-order queries and padded
position/normal samples using integer copies. Below 1,048,576 points,
one pass generates all three outputs; larger inputs retain two passes.
Host payload is
28N + 32M bytes (axes, indices, raw normals and nodes), compared with
64N + 32M for upload. Device output bytes are 64N, with no readback
or completion wait. CPU partitioning, validation and node staging remain.
Removes host packing allocations totaling 64N payload bytes over
construction; fused inputs use two transient buffers totaling 28N
bytes, while the large two-pass path uses up to 28N beside owned outputs.
Small inputs may be slower than default upload; placement is
explicit and existing FPFH device requirements apply.
Sourcepub const fn point_count(&self) -> u32
pub const fn point_count(&self) -> u32
Original point/descriptor count.
Sourcepub const fn upload_transfers(&self) -> TransferStats
pub const fn upload_transfers(&self) -> TransferStats
Payload bytes explicitly transferred at construction, including device output bytes when the GPU gather constructor is selected.
Sourcepub fn radius_neighborhoods_resident(
&self,
runtime: &WgpuRuntime,
radius: f32,
capacity: u32,
) -> SpatialResult<GpuFpfhNeighborhoods>
pub fn radius_neighborhoods_resident( &self, runtime: &WgpuRuntime, radius: f32, capacity: u32, ) -> SpatialResult<GpuFpfhNeighborhoods>
Builds reusable GPU radius neighborhoods for this input, including self. No readback or host wait occurs. All matches are counted; capacity overflow is checked on GPU during descriptor computation and at download.
Sourcepub fn descriptors_resident(
&self,
runtime: &WgpuRuntime,
neighbors: &GpuFpfhNeighborhoods,
) -> SpatialResult<GpuFpfhDescriptors>
pub fn descriptors_resident( &self, runtime: &WgpuRuntime, neighbors: &GpuFpfhNeighborhoods, ) -> SpatialResult<GpuFpfhDescriptors>
Computes GPU SPFH and distance-weighted FPFH using resident neighborhoods from this exact input. Both passes share one submission; results remain on device. Overflow/malformed rows poison the entire output to zero and set status; download rejects that output, and GPU consumers must check status before using it. No automatic CPU fallback or payload copy occurs. GPU angular/bin rounding may differ from CPU near boundaries.