pub struct GpuNeighborhoods { /* private fields */ }Expand description
Immutable GPU-resident bounded neighborhoods. Creating this result submits GPU search without payload uploads/readbacks or a completion wait. Query/target buffers are explicitly uploaded beforehand. Outputs are owned, never pooled.
Implementations§
Source§impl GpuNeighborhoods
impl GpuNeighborhoods
Sourcepub fn buffer(&self) -> &Buffer
pub fn buffer(&self) -> &Buffer
Output storage for subsequent GPU kernels on the same runtime. Each row
has 2 + 2*capacity u32 words: stored count, total count, then pairs of
original target index and f32 squared-distance bits. Nearest rows are
sorted by distance; radius rows retain traversal order. Respect stored
counts; unused slots are zero. Empty results have an unused 8-byte buffer.
Radius consumers must handle total count > capacity before using a row.
Sourcepub const fn query_count(&self) -> u32
pub const fn query_count(&self) -> u32
Number of result rows, in query input order.
Sourcepub const fn capacity(&self) -> u32
pub const fn capacity(&self) -> u32
Maximum stored neighbors per row; radius counts may exceed this.
Sourcepub const fn kind(&self) -> GpuNeighborhoodKind
pub const fn kind(&self) -> GpuNeighborhoodKind
Membership and ordering contract.
Sourcepub const fn readback_bytes(&self) -> u64
pub const fn readback_bytes(&self) -> u64
Payload bytes in a complete explicit readback, including row padding.
Sourcepub fn execution_transfers(&self) -> TransferStats
pub fn execution_transfers(&self) -> TransferStats
Host/device payload transfers performed by search itself. Target/query uploads are separate; uniform control data is excluded.
Sourcepub fn download(
&self,
runtime: &WgpuRuntime,
) -> SpatialResult<GpuNeighborhoodReadback>
pub fn download( &self, runtime: &WgpuRuntime, ) -> SpatialResult<GpuNeighborhoodReadback>
Explicitly downloads rows and exact counts, waiting for queue completion. Use complete_rows/into_complete_rows to reject radius overflow, or truncated_rows to intentionally inspect a bounded traversal prefix.