Skip to main content

spatialrust_gpu/
lib.rs

1//! GPU runtime, device buffers, and kernel dispatch for SpatialRust.
2//!
3//! Unsafe code is restricted to FFI and GPU interop boundaries in this crate.
4
5#![warn(missing_docs)]
6#![deny(unsafe_code)]
7
8mod buffer;
9mod device;
10
11#[cfg(feature = "gpu-wgpu")]
12mod kernels;
13
14#[cfg(feature = "gpu-wgpu")]
15mod pipeline_cache;
16
17#[cfg(feature = "gpu-wgpu")]
18mod readback;
19
20#[cfg(feature = "gpu-wgpu")]
21mod upload_cache;
22
23#[cfg(feature = "gpu-wgpu")]
24mod runtime;
25
26pub use buffer::DeviceBuffer;
27pub use device::{GpuDevice, WgpuDevice};
28
29#[cfg(feature = "gpu-wgpu")]
30pub use kernels::{
31    build_voxel_segments, build_voxel_segments_from_positions_gpu,
32    build_voxel_segments_from_positions_gpu_buffers, build_voxel_segments_gpu,
33    build_voxel_segments_gpu_from_keys_buffer, compact_voxel_segments_from_sorted,
34    compute_voxel_keys, compute_voxel_keys_gpu_buffers, downsample_voxel_approximate_first_gpu,
35    downsample_voxel_centroid_gpu, estimate_normals_gpu, estimate_normals_grid_gpu,
36    estimate_plane_covariances_grid_gpu, gather_voxel_first_f32, gather_voxel_first_f32_gpu,
37    gather_voxel_first_f32_gpu_buffers, gather_voxel_first_f32_multi_gpu,
38    gather_voxel_first_xyz_and_average_multi_gpu, gather_voxel_first_xyz_and_multi_gpu,
39    gather_voxel_first_xyz_gpu_buffers, reduce_voxel_average_f32, reduce_voxel_average_f32_gpu,
40    reduce_voxel_average_f32_gpu_buffers, reduce_voxel_average_f32_multi_gpu,
41    reduce_voxel_centroids_xyz, reduce_voxel_centroids_xyz_and_average_multi_gpu,
42    reduce_voxel_centroids_xyz_and_gather_first_multi_gpu, reduce_voxel_centroids_xyz_gpu_buffers,
43    GpuCovariance, GpuNormal, GpuVoxelKeyBuffers, GpuVoxelSegments, VoxelApproximateFirstGpuResult,
44    VoxelCentroidGpuResult, VoxelSegments,
45};
46
47#[cfg(feature = "gpu-wgpu")]
48pub use runtime::{WgpuRuntime, MULTI_GATHER2_STORAGE_BUFFERS, MULTI_GATHER4_STORAGE_BUFFERS};