arnaucube
arnaucube/poulpyPublic Self-hosted repository
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 module;
19mod reim;
20mod reim4;
21mod scratch;
22mod svp;
23mod vec_znx;
24mod vec_znx_big;
25mod vec_znx_dft;
26mod vmp;
27mod znx_avx;
28
29pub struct FFT64Avx {}
30pub use reim::*;
31
32#[cfg(test)]
33pub mod tests;