Skip to main content

Module gpu

Module gpu 

Source
Expand description

GPU-accelerated vector operations using wgpu (WebGPU).

This module provides optional GPU acceleration for batch distance calculations. Enable with feature flag gpu.

§When to use GPU

  • Batch operations (100+ queries at once)
  • Large datasets (500K+ vectors)
  • Index construction (HNSW graph building)

For single queries on datasets ≤100K, CPU SIMD remains faster.

§Platform Support

PlatformBackend
WindowsDirectX 12 / Vulkan
macOSMetal
LinuxVulkan
BrowserWebGPU

Functions§

should_traverse_gpu
Check if GPU traversal is worthwhile (always false without GPU HNSW traversal support).
should_use_gpu
Check if GPU dispatch is worthwhile (always false without gpu feature).