Skip to main content

Module gpu

Module gpu 

Source
Expand description

GPU acceleration abstractions for vector operations

This module provides GPU acceleration abstractions for:

  • Distance calculations (cosine, euclidean, etc.)
  • Batch vector operations
  • Parallel search algorithms
  • Matrix operations for embeddings

§Pure Rust Policy (COOLJAPAN Pure Rust Policy v2)

This module is 100% Pure Rust: all buffers, devices, streams and kernels here are CPU-backed reference implementations with no C FFI. Real NVIDIA CUDA acceleration (cuda-runtime-sys) is quarantined in the companion oxirs-vec-adapter-cuda crate (publish = false), which depends on this crate and reuses these public types. This keeps oxirs-vec’s published --all-features surface free of cuda-runtime-sys.

Re-exports§

pub use accelerator::create_default_accelerator;
pub use accelerator::create_memory_optimized_accelerator;
pub use accelerator::create_performance_accelerator;
pub use accelerator::is_gpu_available;
pub use accelerator::GpuAccelerator;
pub use buffer::GpuBuffer;
pub use config::GpuConfig;
pub use config::OptimizationLevel;
pub use config::PrecisionMode;
pub use device::GpuDevice;
pub use index::AdvancedGpuVectorIndex;
pub use index::BatchVectorProcessor;
pub use index::GpuVectorIndex;
pub use index_builder::BatchSizeCalculator;
pub use index_builder::ComputedBatch;
pub use index_builder::GpuBatchDistanceComputer;
pub use index_builder::GpuDistanceMetric;
pub use index_builder::GpuHnswIndexBuilder;
pub use index_builder::GpuIndexBuildStats;
pub use index_builder::GpuIndexBuilderConfig;
pub use index_builder::GpuIndexOptimizer;
pub use index_builder::GpuMemoryBudget;
pub use index_builder::HnswGraph;
pub use index_builder::HnswNode;
pub use index_builder::IncrementalGpuIndexBuilder;
pub use index_builder::IndexedBatch;
pub use index_builder::PipelinedIndexBuilder;
pub use index_builder::PreparedBatch;
pub use load_balancer::GpuLoadBalancer;
pub use load_balancer::SimpleGpuDevice;
pub use load_balancer::WorkloadChunk;
pub use load_balancer::WorkloadDistributor;
pub use memory_pool::GpuMemoryPool;
pub use multi_gpu::GpuDeviceMetrics;
pub use multi_gpu::GpuTaskOutput;
pub use multi_gpu::GpuTaskResult;
pub use multi_gpu::LoadBalancingStrategy;
pub use multi_gpu::MultiGpuConfig;
pub use multi_gpu::MultiGpuConfigFactory;
pub use multi_gpu::MultiGpuManager;
pub use multi_gpu::MultiGpuStats;
pub use multi_gpu::MultiGpuTask;
pub use multi_gpu::TaskPriority;
pub use performance::GpuPerformanceStats;
pub use types::GpuExecutionConfig;
pub use kernels::*;

Modules§

accelerator
Main GPU accelerator implementation
buffer
GPU memory buffer management
config
GPU configuration structures and enums
device
GPU device information and management
index
GPU-accelerated vector index implementations
index_builder
GPU-accelerated HNSW index construction
index_builder_phases
Phase implementations for GPU-accelerated HNSW index construction.
index_builder_types
Types, configuration, and data structures for GPU-accelerated HNSW index building.
kernels
CUDA kernel implementations for various vector operations
load_balancer
GPU load balancing for distributing index-building work across multiple devices.
memory_pool
GPU memory pool management for efficient allocation and reuse
multi_gpu
Multi-GPU load balancing for distributed vector index operations
performance
GPU performance monitoring and statistics
runtime
CUDA runtime types and utilities
types
Common GPU types and structures