1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
//! `zer-compute`, hardware-accelerated backend for entity resolution.
//!
//! Provides [`DeviceComparator`] and [`DeviceScorer`] as drop-in replacements for
//! the CPU-only counterparts in `zer-compare`. Both implement the same
//! [`zer_core::traits::Comparator`] and [`zer_core::traits::Scorer`]
//! traits, so the rest of the pipeline is backend-agnostic.
//!
//! # Backend selection
//!
//! ```rust
//! use std::sync::Arc;
//! use zer_compute::{GpuBackend, DeviceComparator, DeviceScorer};
//! use zer_core::schema::{FieldKind, SchemaBuilder};
//!
//! let schema = SchemaBuilder::new()
//! .field("naam", FieldKind::Name)
//! .field("datum", FieldKind::Date)
//! .build()
//! .unwrap();
//!
//! // Auto-detect: tries CUDA → AVX2 → CPU in order.
//! let backend = Arc::new(GpuBackend::auto_detect());
//! let comparator = DeviceComparator::new(Arc::clone(&backend), &schema).unwrap();
//! let scorer = DeviceScorer::new(Arc::clone(&backend));
//! ```
//!
//! # Feature flags
//!
//! | Flag | Description |
//! |------------------|---|
//! | `cuda` | NVIDIA CUDA via `cudarc`, requires CUDA Toolkit 13.1+ and `nvcc` at build time |
//! | `vulkan` | Vulkan 1.3 compute via `ash`, requires `slangc` on `PATH` at build time |
//! | `avx2` | x86_64 AVX2 SIMD via `std::arch`, no external toolchain required |
//! | `cpu` | Explicit scalar CPU path backed by `zer-compare` (Rayon parallel) |
//! | `debug-shaders` | Embed debug info in compiled CUDA kernels for `cuda-gdb` / Nsight stepping |
//!
//! When no flag is set the crate compiles and runs normally using the
//! always-available scalar CPU fallback backed by `zer-compare`.
pub use ;
pub use BatchSizer;
pub use DeviceComparator;
pub use GpuError;
pub use DeviceScorer;