poulpy/poulpy-cpu-avx/benches/convolution.rs
poulpy-cpu-avx/benches/convolution.rsRaw
1use criterion::{Criterion, criterion_group, criterion_main};
2
3#[cfg(not(all(
4 feature = "enable-avx",
5 target_arch = "x86_64",
6 target_feature = "avx2",
7 target_feature = "fma"
8)))]
9fn bench_cnv_prepare_left_cpu_avx_fft64(_c: &mut Criterion) {
10 eprintln!("Skipping: AVX IFft benchmark requires x86_64 + AVX2 + FMA");
11}
12
13#[cfg(all(
14 feature = "enable-avx",
15 target_arch = "x86_64",
16 target_feature = "avx2",
17 target_feature = "fma"
18))]
19fn bench_cnv_prepare_left_cpu_avx_fft64(c: &mut Criterion) {
20 use poulpy_cpu_avx::FFT64Avx;
21 poulpy_hal::bench_suite::convolution::bench_cnv_prepare_left::<FFT64Avx>(c, "cpu_avx::fft64");
22}
23
24#[cfg(not(all(
25 feature = "enable-avx",
26 target_arch = "x86_64",
27 target_feature = "avx2",
28 target_feature = "fma"
29)))]
30fn bench_cnv_prepare_right_cpu_avx_fft64(_c: &mut Criterion) {
31 eprintln!("Skipping: AVX IFft benchmark requires x86_64 + AVX2 + FMA");
32}
33
34#[cfg(all(
35 feature = "enable-avx",
36 target_arch = "x86_64",
37 target_feature = "avx2",
38 target_feature = "fma"
39))]
40fn bench_cnv_prepare_right_cpu_avx_fft64(c: &mut Criterion) {
41 use poulpy_cpu_avx::FFT64Avx;
42 poulpy_hal::bench_suite::convolution::bench_cnv_prepare_right::<FFT64Avx>(c, "cpu_avx::fft64");
43}
44
45#[cfg(not(all(
46 feature = "enable-avx",
47 target_arch = "x86_64",
48 target_feature = "avx2",
49 target_feature = "fma"
50)))]
51fn bench_cnv_apply_dft_cpu_avx_fft64(_c: &mut Criterion) {
52 eprintln!("Skipping: AVX IFft benchmark requires x86_64 + AVX2 + FMA");
53}
54
55#[cfg(all(
56 feature = "enable-avx",
57 target_arch = "x86_64",
58 target_feature = "avx2",
59 target_feature = "fma"
60))]
61fn bench_cnv_apply_dft_cpu_avx_fft64(c: &mut Criterion) {
62 use poulpy_cpu_avx::FFT64Avx;
63 poulpy_hal::bench_suite::convolution::bench_cnv_apply_dft::<FFT64Avx>(c, "cpu_avx::fft64");
64}
65
66#[cfg(not(all(
67 feature = "enable-avx",
68 target_arch = "x86_64",
69 target_feature = "avx2",
70 target_feature = "fma"
71)))]
72fn bench_cnv_pairwise_apply_dft_cpu_avx_fft64(_c: &mut Criterion) {
73 eprintln!("Skipping: AVX IFft benchmark requires x86_64 + AVX2 + FMA");
74}
75
76#[cfg(all(
77 feature = "enable-avx",
78 target_arch = "x86_64",
79 target_feature = "avx2",
80 target_feature = "fma"
81))]
82fn bench_cnv_pairwise_apply_dft_cpu_avx_fft64(c: &mut Criterion) {
83 use poulpy_cpu_avx::FFT64Avx;
84 poulpy_hal::bench_suite::convolution::bench_cnv_pairwise_apply_dft::<FFT64Avx>(c, "cpu_avx::fft64");
85}
86
87#[cfg(not(all(
88 feature = "enable-avx",
89 target_arch = "x86_64",
90 target_feature = "avx2",
91 target_feature = "fma"
92)))]
93fn bench_cnv_by_const_apply_cpu_avx_fft64(_c: &mut Criterion) {
94 eprintln!("Skipping: AVX IFft benchmark requires x86_64 + AVX2 + FMA");
95}
96
97#[cfg(all(
98 feature = "enable-avx",
99 target_arch = "x86_64",
100 target_feature = "avx2",
101 target_feature = "fma"
102))]
103fn bench_cnv_by_const_apply_cpu_avx_fft64(c: &mut Criterion) {
104 use poulpy_cpu_avx::FFT64Avx;
105 poulpy_hal::bench_suite::convolution::bench_cnv_by_const_apply::<FFT64Avx>(c, "cpu_avx::fft64");
106}
107
108criterion_group!(
109 benches,
110 bench_cnv_prepare_left_cpu_avx_fft64,
111 bench_cnv_prepare_right_cpu_avx_fft64,
112 bench_cnv_apply_dft_cpu_avx_fft64,
113 bench_cnv_pairwise_apply_dft_cpu_avx_fft64,
114 bench_cnv_by_const_apply_cpu_avx_fft64,
115);
116criterion_main!(benches);