Expand description
SIMD (Single Instruction, Multiple Data) optimization utilities.
This module provides SIMD optimization infrastructure:
- Platform detection (AVX2, AVX-512, NEON, etc.)
- Vectorization hints for the compiler
- SIMD-friendly data layouts and alignment
- Automatic vectorization checking
- Performance benchmarking for SIMD operations
§Example
ⓘ
use tensorlogic_infer::{SimdCapabilities, SimdOptimizer, AlignedBuffer};
// Check SIMD capabilities
let caps = SimdCapabilities::detect();
println!("AVX2 supported: {}", caps.has_avx2());
// Create aligned buffer for SIMD operations
let buffer = AlignedBuffer::<f32>::new(1024);
// Optimize operations for SIMD
let optimizer = SimdOptimizer::new(caps);
let optimized_graph = optimizer.optimize(&graph)?;Structs§
- Aligned
Buffer - Aligned buffer for SIMD operations.
- Simd
Capabilities - SIMD capabilities detection.
- Simd
Optimization Hints - SIMD optimization hints.
Enums§
- CpuArchitecture
- CPU architecture.
- Simd
Error - SIMD optimization errors.
- Simd
Instruction Set - SIMD instruction set.
Functions§
- alignment_
offset - Get the alignment offset needed to align a pointer.
- is_
simd_ aligned - Check if a pointer is aligned for SIMD operations.
- vectorize_
hint - Vectorization hint for the compiler.