arnaucube
arnaucube/poulpyPublic Self-hosted repository
poulpy/poulpy-cpu-avx/benches/vec_znx.rs
poulpy-cpu-avx/benches/vec_znx.rsRaw
 1use criterion::{Criterion, criterion_group, criterion_main};
 2
 3#[cfg(not(all(feature = "enable-avx", target_arch = "x86_64", target_feature = "avx2", target_feature = "fma")))]
 4fn bench_vec_znx_add_cpu_avx_fft64(_c: &mut Criterion) {
 5    eprintln!("Skipping: AVX IFft benchmark requires x86_64 + AVX2 + FMA");
 6}
 7
 8#[cfg(all(feature = "enable-avx", target_arch = "x86_64", target_feature = "avx2", target_feature = "fma"))]
 9fn bench_vec_znx_add_cpu_avx_fft64(c: &mut Criterion) {
10    use poulpy_cpu_avx::FFT64Avx;
11    poulpy_hal::reference::vec_znx::bench_vec_znx_add::<FFT64Avx>(c, "FFT64Avx");
12}
13
14#[cfg(not(all(feature = "enable-avx", target_arch = "x86_64", target_feature = "avx2", target_feature = "fma")))]
15fn bench_vec_znx_normalize_inplace_cpu_avx_fft64(_c: &mut Criterion) {
16    eprintln!("Skipping: AVX IFft benchmark requires x86_64 + AVX2 + FMA");
17}
18
19#[cfg(all(feature = "enable-avx", target_arch = "x86_64", target_feature = "avx2", target_feature = "fma"))]
20fn bench_vec_znx_normalize_inplace_cpu_avx_fft64(c: &mut Criterion) {
21    use poulpy_cpu_avx::FFT64Avx;
22    poulpy_hal::reference::vec_znx::bench_vec_znx_normalize_inplace::<FFT64Avx>(c, "FFT64Avx");
23}
24
25#[cfg(not(all(feature = "enable-avx", target_arch = "x86_64", target_feature = "avx2", target_feature = "fma")))]
26fn bench_vec_znx_automorphism_cpu_avx_fft64(_c: &mut Criterion) {
27    eprintln!("Skipping: AVX IFft benchmark requires x86_64 + AVX2 + FMA");
28}
29
30#[cfg(all(feature = "enable-avx", target_arch = "x86_64", target_feature = "avx2", target_feature = "fma"))]
31fn bench_vec_znx_automorphism_cpu_avx_fft64(c: &mut Criterion) {
32    use poulpy_cpu_avx::FFT64Avx;
33    poulpy_hal::reference::vec_znx::bench_vec_znx_automorphism::<FFT64Avx>(c, "FFT64Avx");
34}
35
36criterion_group!(
37    benches,
38    bench_vec_znx_add_cpu_avx_fft64,
39    bench_vec_znx_normalize_inplace_cpu_avx_fft64,
40    bench_vec_znx_automorphism_cpu_avx_fft64,
41);
42criterion_main!(benches);