Expand description
Unified SIMD Dispatch Architecture
This module provides compile-time and runtime CPU feature detection and dispatch for SIMD operations.
§Architecture
The dispatch system supports two modes:
- Compile-Time Dispatch (
#[cfg]attributes): Used when target is known - Runtime Dispatch (CPUID/feature detection): For portable binaries
§Usage
ⓘ
use sochdb_vector::simd::dispatch::{cpu_features, simd_level, SimdLevel};
let features = cpu_features();
if features.has_avx2 {
println!("AVX2 is available!");
}
match simd_level() {
SimdLevel::Avx512 => println!("Using AVX-512"),
SimdLevel::Avx2 => println!("Using AVX2"),
SimdLevel::Neon => println!("Using NEON"),
_ => println!("Using scalar fallback"),
}Structs§
- CpuFeatures
- CPU feature flags detected at runtime.
Enums§
- Simd
Level - SIMD capability level.
Functions§
- cpu_
features - Get detected CPU features (cached).
- dispatch_
info - Get a human-readable description of SIMD capabilities.
- simd_
available - Check if SIMD acceleration is available.
- simd_
level - Get best available SIMD level.