Expand description
SIMD capability detection and runtime optimization. SIMD capability detection and runtime optimization.
This module provides runtime detection of CPU SIMD features to enable performance warnings and feature-appropriate code paths.
§Example
use edgevec::simd::{capabilities, warn_if_suboptimal, SimdCapabilities};
// Get detected capabilities
let caps = capabilities();
println!("AVX2 available: {}", caps.avx2);
// Check if configuration is optimal
if !caps.is_optimal() {
// Warn user about performance impact
warn_if_suboptimal();
}§Backend Selection
use edgevec::simd::{select_backend, SimdBackend};
let backend = select_backend();
match backend {
SimdBackend::Avx2 => println!("Using AVX2 (256-bit)"),
SimdBackend::Avx => println!("Using AVX (256-bit)"),
SimdBackend::Sse41 => println!("Using SSE4.1 (128-bit)"),
SimdBackend::Neon => println!("Using NEON (128-bit)"),
SimdBackend::Portable => println!("Using portable fallback"),
}Re-exports§
pub use detect::capabilities;pub use detect::warn_if_suboptimal;pub use detect::SimdCapabilities;
Modules§
- detect
- Runtime SIMD capability detection
Enums§
- Simd
Backend - Available SIMD backends for runtime dispatch.
Functions§
- detect_
neon - Detect NEON SIMD support at runtime.
- select_
backend - Select the best available SIMD backend for the current CPU.