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
//! SIMD optimizations for HQC operations
//!
//! Provides AVX2-optimized implementations with runtime detection
//! and automatic fallback to portable code.
//!
//! ## Architecture
//!
//! This module follows the libQ SIMD architecture pattern:
//! - Runtime CPU feature detection with portable fallback
//! - Optional feature flag: `simd-avx2`
//! - Separate implementations for different SIMD instruction sets
//! - Trait-based interface for polymorphic dispatch
//!
//! ## Usage
//!
//! ```rust,ignore
//! use lib_q_hqc::simd::runtime::has_avx2;
//! use lib_q_hqc::simd::PolynomialOps;
//!
//! if has_avx2() {
//! // Use AVX2 optimized implementation
//! crate::simd::Avx2::sparse_dense_mul(output, a, b, weight, n_bits);
//! } else {
//! // Use portable implementation
//! crate::simd::Portable::sparse_dense_mul(output, a, b, weight, n_bits);
//! }
//! ```
/// Runtime CPU feature detection and dispatch
// Re-export traits and ZST markers
pub use Avx2;
pub use Portable;
pub use ;