Update to non-avx builds

This commit is contained in:
Pro7ech
2025-11-21 15:39:04 +01:00
parent 0fb88c9bd3
commit 3c818d292b
24 changed files with 356 additions and 128 deletions

View File

@@ -1,11 +1,17 @@
#![cfg(target_arch = "x86_64")]
use std::hint::black_box;
use criterion::{Criterion, criterion_group, criterion_main};
use criterion::{BenchmarkId, Criterion, criterion_group, criterion_main};
use poulpy_cpu_avx::{ReimFFTAvx, ReimIFFTAvx};
use poulpy_hal::reference::fft64::reim::{ReimDFTExecute, ReimFFTTable, ReimIFFTTable};
#[cfg(not(all(feature = "enable-avx", target_arch = "x86_64", target_feature = "avx2", target_feature = "fma")))]
fn bench_ifft_avx2_fma(_c: &mut Criterion) {
eprintln!("Skipping: AVX IFft benchmark requires x86_64 + AVX2 + FMA");
}
#[cfg(all(feature = "enable-avx", target_arch = "x86_64", target_feature = "avx2", target_feature = "fma"))]
pub fn bench_ifft_avx2_fma(c: &mut Criterion) {
use criterion::BenchmarkId;
use poulpy_cpu_avx::ReimIFFTAvx;
use poulpy_hal::reference::fft64::reim::{ReimDFTExecute, ReimIFFTTable};
use std::hint::black_box;
let group_name: String = "ifft_avx2_fma".to_string();
let mut group = c.benchmark_group(group_name);
@@ -41,7 +47,18 @@ pub fn bench_ifft_avx2_fma(c: &mut Criterion) {
group.finish();
}
#[cfg(not(all(feature = "enable-avx", target_arch = "x86_64", target_feature = "avx2", target_feature = "fma")))]
fn bench_fft_avx2_fma(_c: &mut Criterion) {
eprintln!("Skipping: AVX FFT benchmark requires x86_64 + AVX2 + FMA");
}
#[cfg(all(feature = "enable-avx", target_arch = "x86_64", target_feature = "avx2", target_feature = "fma"))]
pub fn bench_fft_avx2_fma(c: &mut Criterion) {
use criterion::BenchmarkId;
use poulpy_cpu_avx::ReimFFTAvx;
use poulpy_hal::reference::fft64::reim::{ReimDFTExecute, ReimFFTTable};
use std::hint::black_box;
let group_name: String = "fft_avx2_fma".to_string();
let mut group = c.benchmark_group(group_name);

View File

@@ -1,21 +1,36 @@
#![cfg(target_arch = "x86_64")]
// poulpy-backend/benches/vec_znx_add.rs
use criterion::{Criterion, criterion_group, criterion_main};
use poulpy_cpu_avx::FFT64Avx;
use poulpy_hal::reference::vec_znx::{bench_vec_znx_add, bench_vec_znx_automorphism, bench_vec_znx_normalize_inplace};
#[allow(dead_code)]
#[cfg(not(all(feature = "enable-avx", target_arch = "x86_64", target_feature = "avx2", target_feature = "fma")))]
fn bench_vec_znx_add_cpu_avx_fft64(_c: &mut Criterion) {
eprintln!("Skipping: AVX IFft benchmark requires x86_64 + AVX2 + FMA");
}
#[cfg(all(feature = "enable-avx", target_arch = "x86_64", target_feature = "avx2", target_feature = "fma"))]
fn bench_vec_znx_add_cpu_avx_fft64(c: &mut Criterion) {
bench_vec_znx_add::<FFT64Avx>(c, "FFT64Avx");
use poulpy_cpu_avx::FFT64Avx;
poulpy_hal::reference::vec_znx::bench_vec_znx_add::<FFT64Avx>(c, "FFT64Avx");
}
#[allow(dead_code)]
#[cfg(not(all(feature = "enable-avx", target_arch = "x86_64", target_feature = "avx2", target_feature = "fma")))]
fn bench_vec_znx_normalize_inplace_cpu_avx_fft64(_c: &mut Criterion) {
eprintln!("Skipping: AVX IFft benchmark requires x86_64 + AVX2 + FMA");
}
#[cfg(all(feature = "enable-avx", target_arch = "x86_64", target_feature = "avx2", target_feature = "fma"))]
fn bench_vec_znx_normalize_inplace_cpu_avx_fft64(c: &mut Criterion) {
bench_vec_znx_normalize_inplace::<FFT64Avx>(c, "FFT64Avx");
use poulpy_cpu_avx::FFT64Avx;
poulpy_hal::reference::vec_znx::bench_vec_znx_normalize_inplace::<FFT64Avx>(c, "FFT64Avx");
}
#[cfg(not(all(feature = "enable-avx", target_arch = "x86_64", target_feature = "avx2", target_feature = "fma")))]
fn bench_vec_znx_automorphism_cpu_avx_fft64(_c: &mut Criterion) {
eprintln!("Skipping: AVX IFft benchmark requires x86_64 + AVX2 + FMA");
}
#[cfg(all(feature = "enable-avx", target_arch = "x86_64", target_feature = "avx2", target_feature = "fma"))]
fn bench_vec_znx_automorphism_cpu_avx_fft64(c: &mut Criterion) {
bench_vec_znx_automorphism::<FFT64Avx>(c, "FFT64Avx");
use poulpy_cpu_avx::FFT64Avx;
poulpy_hal::reference::vec_znx::bench_vec_znx_automorphism::<FFT64Avx>(c, "FFT64Avx");
}
criterion_group!(

View File

@@ -1,27 +1,15 @@
// poulpy-backend/benches/vec_znx_add.rs
use criterion::{Criterion, criterion_group, criterion_main};
#[cfg(target_arch = "x86_64")]
use poulpy_cpu_avx::FFT64Avx;
#[cfg(not(target_arch = "x86_64"))]
use poulpy_cpu_ref::FFT64Ref;
use poulpy_hal::bench_suite::vmp::bench_vmp_apply_dft_to_dft;
#[cfg(not(all(feature = "enable-avx", target_arch = "x86_64", target_feature = "avx2", target_feature = "fma")))]
fn bench_vmp_apply_dft_to_dft_cpu_avx_fft64(_c: &mut Criterion) {
eprintln!("Skipping: AVX IFft benchmark requires x86_64 + AVX2 + FMA");
}
#[cfg(target_arch = "x86_64")]
#[cfg(all(feature = "enable-avx", target_arch = "x86_64", target_feature = "avx2", target_feature = "fma"))]
fn bench_vmp_apply_dft_to_dft_cpu_avx_fft64(c: &mut Criterion) {
bench_vmp_apply_dft_to_dft::<FFT64Avx>(c, "FFT64Avx");
}
#[cfg(not(target_arch = "x86_64"))]
fn bench_vmp_apply_dft_to_dft_cpu_ref_fft64(c: &mut Criterion) {
bench_vmp_apply_dft_to_dft::<FFT64Ref>(c, "FFT64Ref");
use poulpy_cpu_avx::FFT64Avx;
poulpy_hal::bench_suite::vmp::bench_vmp_apply_dft_to_dft::<FFT64Avx>(c, "FFT64Avx");
}
#[cfg(target_arch = "x86_64")]
criterion_group!(benches_x86, bench_vmp_apply_dft_to_dft_cpu_avx_fft64,);
#[cfg(not(target_arch = "x86_64"))]
criterion_group!(benches_ref, bench_vmp_apply_dft_to_dft_cpu_ref_fft64,);
#[cfg(target_arch = "x86_64")]
criterion_main!(benches_x86);
#[cfg(not(target_arch = "x86_64"))]
criterion_main!(benches_ref);