macro_rules! impl_avx512vnni_bf16_dsp {
() => {
#[inline(always)]
unsafe fn convolve_stereo(
coeffs: *const f32,
input_l: *const f32,
input_r: *const f32,
taps: usize,
) -> (f32, f32) {
unsafe { Avx512Math::convolve_stereo(coeffs, input_l, input_r, taps) }
}
#[inline(always)]
unsafe fn convolve_stereo_dual(
coeffs0: *const f32,
coeffs1: *const f32,
input_l: *const f32,
input_r: *const f32,
taps: usize,
) -> ((f32, f32), (f32, f32)) {
unsafe { Avx512Math::convolve_stereo_dual(coeffs0, coeffs1, input_l, input_r, taps) }
}
#[inline(always)]
unsafe fn convolve_mono(coeffs: *const f32, input: *const f32, taps: usize) -> f32 {
unsafe { Avx512Math::convolve_mono(coeffs, input, taps) }
}
#[inline(always)]
unsafe fn convolve_mono_dual(
coeffs0: *const f32,
coeffs1: *const f32,
input: *const f32,
taps: usize,
) -> (f32, f32) {
unsafe { Avx512Math::convolve_mono_dual(coeffs0, coeffs1, input, taps) }
}
#[inline(always)]
unsafe fn apply_gain_and_detect_clipping_mono(data: &mut [f32], gain: f32) -> bool {
Avx512Math::apply_gain_and_detect_clipping_mono(data, gain)
}
#[inline(always)]
unsafe fn apply_gain_and_detect_clipping_stereo(
left: &mut [f32],
right: &mut [f32],
gain: f32,
) -> bool {
Avx512Math::apply_gain_and_detect_clipping_stereo(left, right, gain)
}
#[inline(always)]
unsafe fn apply_gain_stereo(left: &mut [f32], right: &mut [f32], gain: f32) {
Avx512Math::apply_gain_stereo(left, right, gain)
}
#[inline(always)]
unsafe fn apply_gain(data: &mut [f32], gain: f32) {
crate::math::dsp::gain::apply_gain_avx512(data, gain)
}
#[inline(always)]
unsafe fn apply_ramp(data: &mut [f32], start: f32, step: f32) {
Avx512Math::apply_ramp(data, start, step)
}
#[inline(always)]
unsafe fn apply_ramp_stereo(left: &mut [f32], right: &mut [f32], start: f32, step: f32) {
Avx512Math::apply_ramp_stereo(left, right, start, step)
}
#[inline(always)]
unsafe fn apply_gain_then_dither(data: &mut [f32], gain: f32, offset: f32) {
Avx512Math::apply_gain_then_dither(data, gain, offset)
}
#[inline(always)]
unsafe fn apply_dither_add(data: &mut [f32], offset: f32) {
Avx512Math::apply_dither_add(data, offset)
}
#[inline(always)]
unsafe fn crossfade_blend_mono(out: &mut [f32], pending: &[f32], t: f32) {
Avx512Math::crossfade_blend_mono(out, pending, t)
}
#[inline(always)]
unsafe fn complex_mac_overwrite(
h_re: &[f32],
h_im: &[f32],
x_re: &[f32],
x_im: &[f32],
out_re: &mut [f32],
out_im: &mut [f32],
) {
Avx512Math::complex_mac_overwrite(h_re, h_im, x_re, x_im, out_re, out_im)
}
#[inline(always)]
unsafe fn complex_mac_accumulate(
h_re: &[f32],
h_im: &[f32],
x_re: &[f32],
x_im: &[f32],
acc_re: &mut [f32],
acc_im: &mut [f32],
) {
Avx512Math::complex_mac_accumulate(h_re, h_im, x_re, x_im, acc_re, acc_im)
}
#[inline(always)]
unsafe fn fft_butterfly_stage(
re: *mut f32,
im: *mut f32,
half: usize,
tw_re: *const f32,
tw_im: *const f32,
group_start: usize,
inverse: bool,
) {
Avx512Math::fft_butterfly_stage(re, im, half, tw_re, tw_im, group_start, inverse)
}
#[inline(always)]
unsafe fn batch_norm_process(
data: &mut [f32],
scale: &[f32],
offset: &[f32],
n_ch: usize,
num_frames: usize,
) {
Avx512Math::batch_norm_process(data, scale, offset, n_ch, num_frames)
}
};
}