poulpy/poulpy-cpu-avx/src/lib.rs
poulpy-cpu-avx/src/lib.rsRaw
1// ─────────────────────────────────────────────────────────────
2// Build the backend **only when ALL conditions are satisfied**
3// ─────────────────────────────────────────────────────────────
4//#![cfg(all(feature = "enable-avx", target_arch = "x86_64", target_feature = "avx2", target_feature = "fma"))]
5
6// If the user enables this backend but targets a non-x86_64 CPU → abort
7#[cfg(all(feature = "enable-avx", not(target_arch = "x86_64")))]
8compile_error!("feature `enable-avx` requires target_arch = \"x86_64\".");
9
10// If the user enables this backend but AVX2 isn't enabled in the target → abort
11#[cfg(all(feature = "enable-avx", target_arch = "x86_64", not(target_feature = "avx2")))]
12compile_error!("feature `enable-avx` requires AVX2. Build with RUSTFLAGS=\"-C target-feature=+avx2\".");
13
14// If the user enables this backend but FMA isn't enabled in the target → abort
15#[cfg(all(feature = "enable-avx", target_arch = "x86_64", not(target_feature = "fma")))]
16compile_error!("feature `enable-avx` requires FMA. Build with RUSTFLAGS=\"-C target-feature=+fma\".");
17
18mod convolution;
19mod module;
20mod reim;
21mod reim4;
22mod scratch;
23mod svp;
24mod vec_znx;
25mod vec_znx_big;
26mod vec_znx_dft;
27mod vmp;
28mod znx_avx;
29
30pub struct FFT64Avx {}
31pub use reim::*;
32
33#[cfg(test)]
34pub mod tests;