Skip to main content

hive_gpu/
lib.rs

1//! Hive GPU - High-performance GPU acceleration for vector operations
2//!
3//! This crate provides GPU-accelerated vector operations using Metal (Apple Silicon)
4//! and CUDA (NVIDIA) backends for maximum performance in vector similarity search.
5
6pub mod error;
7pub mod traits;
8pub mod types;
9
10// Re-export commonly used types
11pub use error::{HiveGpuError, Result};
12pub use traits::{
13    BufferPoolStats, BufferType, GpuBackend, GpuBuffer, GpuBufferManager, GpuContext, GpuMonitor,
14    GpuVectorStorage, VramBufferInfo, VramStats,
15};
16pub use types::{
17    GpuCapabilities, GpuDeviceInfo, GpuDistanceMetric, GpuMemoryStats, GpuSearchResult, GpuVector,
18    HnswConfig, IvfConfig, VectorMetadata,
19};
20
21// Platform-specific modules
22#[cfg(all(target_os = "macos", feature = "metal-native"))]
23pub mod metal;
24
25#[cfg(feature = "cuda")]
26pub mod cuda;
27
28#[cfg(all(feature = "rocm", target_os = "linux"))]
29pub mod rocm;
30
31#[cfg(all(feature = "intel", any(target_os = "linux", target_os = "windows")))]
32pub mod intel;
33
34// Backend detection
35pub mod backends;
36
37// Monitoring utilities
38pub mod monitoring;
39
40// Shader management
41pub mod shaders;
42
43// Utility functions
44pub mod utils;
45
46// Version information
47pub const VERSION: &str = env!("CARGO_PKG_VERSION");
48
49// Include test modules
50// #[cfg(test)]
51// mod tests;