Expand description
GPU acceleration for spatial algorithms
This module provides GPU-accelerated implementations of spatial algorithms for massive datasets that benefit from parallel computation on graphics cards. It integrates with the existing SIMD and memory pool optimizations to provide the highest possible performance.
§Features
- GPU distance matrix computation: Massive parallel distance calculations
- GPU clustering algorithms: K-means and DBSCAN on GPU
- GPU nearest neighbor search: Optimized spatial queries
- Hybrid CPU-GPU algorithms: Automatic workload distribution
- Memory-mapped GPU transfers: Minimize data movement overhead
- Multi-GPU support: Scale across multiple graphics cards
§Architecture Support
The GPU acceleration is designed to work with:
- NVIDIA GPUs (CUDA backend via cupy/rust-cuda)
- AMD GPUs (ROCm backend)
- Intel GPUs (Level Zero backend)
- Vulkan compute for cross-platform support
§Examples
use scirs2_spatial::gpu_accel::{GpuDistanceMatrix, GpuKMeans};
use scirs2_core::ndarray::array;
// GPU distance matrix computation
let points = array![[0.0, 0.0], [1.0, 0.0], [0.0, 1.0], [1.0, 1.0]];
let gpu_matrix = GpuDistanceMatrix::new()?;
let distances = gpu_matrix.compute_parallel(&points.view()).await?;
println!("GPU distance matrix: {:?}", distances);
// GPU K-means clustering
let gpu_kmeans = GpuKMeans::new(2)?;
let (centroids, assignments) = gpu_kmeans.fit(&points.view()).await?;
println!("GPU centroids: {:?}", centroids);Structs§
- GpuCapabilities
- GPU device capabilities and information
- GpuDevice
- GPU device management and capability detection
- GpuDistance
Matrix - GPU-accelerated distance matrix computation
- GpuK
Means - GPU-accelerated K-means clustering
- GpuNearest
Neighbors - GPU-accelerated nearest neighbor search
- Hybrid
Processor - Hybrid CPU-GPU workload distribution
Enums§
- GpuBackend
- Supported GPU backends
- Processing
Strategy - Processing strategy for workload distribution
Functions§
- get_
gpu_ capabilities - Get GPU capabilities
- global_
gpu_ device - Get the global GPU device instance
- is_
gpu_ acceleration_ available - Check if GPU acceleration is available globally
- report_
gpu_ status - Report GPU acceleration status