diff --git a/src/intrinfft.rs b/src/intrinsic/intrinfft.rs similarity index 100% rename from src/intrinfft.rs rename to src/intrinsic/intrinfft.rs diff --git a/src/intrinsic/mod.rs b/src/intrinsic/mod.rs new file mode 100644 index 0000000..adfabe3 --- /dev/null +++ b/src/intrinsic/mod.rs @@ -0,0 +1,2 @@ +#[cfg(target_arch = "x86_64")] +pub mod intrinfft; diff --git a/src/lib.rs b/src/lib.rs index 1d03a9c..a7c6ac8 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,5 +1,6 @@ pub mod freq_scale; -pub mod intrinfft; +#[cfg(target_arch = "x86_64")] +pub mod intrinsic; pub mod pfft; pub mod rfft; pub mod sfft; diff --git a/src/main.rs b/src/main.rs index 40e2bda..acb35ac 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,9 +1,12 @@ -mod intrinfft; mod pfft; mod rfft; mod sfft; -mod splitfft; mod utils; +mod splitfft; +mod intrinsic; + +#[cfg(target_arch = "x86_64")] +use intrinsic::intrinfft; use num_complex::Complex; use rustfft::FftPlanner; @@ -63,23 +66,26 @@ fn main() { ); utils::dump_result("rayon", &mut result, output_filename).unwrap(); - let mut result = bench_fft( - intrinfft::simd_fft, - intrinfft::simd_ifft, - benchname, - "SIMD", - bench_niter, - ); - utils::dump_result("simd", &mut result, output_filename).unwrap(); - - let mut result = bench_fft( - intrinfft::rayon_simd_fft, - intrinfft::rayon_simd_ifft, - benchname, - "Rayon SIMD", - bench_niter, - ); - utils::dump_result("rayon simd", &mut result, output_filename).unwrap(); + #[cfg(target_arch = "x86_64")] + { + let mut result = bench_fft( + intrinfft::simd_fft, + intrinfft::simd_ifft, + benchname, + "SIMD", + bench_niter, + ); + utils::dump_result("simd", &mut result, output_filename).unwrap(); + + let mut result = bench_fft( + intrinfft::rayon_simd_fft, + intrinfft::rayon_simd_ifft, + benchname, + "Rayon SIMD", + bench_niter, + ); + utils::dump_result("rayon simd", &mut result, output_filename).unwrap(); + } let mut result = bench_fft( splitfft::fft, diff --git a/tests/accuracy.rs b/tests/accuracy.rs index 663827d..14c7ab5 100644 --- a/tests/accuracy.rs +++ b/tests/accuracy.rs @@ -1,5 +1,6 @@ use ffrust::freq_scale; -use ffrust::intrinfft; +#[cfg(target_arch = "x86_64")] +use ffrust::intrinsic::intrinfft; use ffrust::pfft; use ffrust::rfft; use ffrust::sfft; @@ -53,11 +54,13 @@ fn test_rayon_fft() { run_fft_ifft(pfft::rayon_fft, pfft::rayon_ifft, "rayon_recon.wav"); } +#[cfg(target_arch = "x86_64")] #[test] fn test_simd_fft() { run_fft_ifft(intrinfft::simd_fft, intrinfft::simd_ifft, "simd_recon.wav"); } +#[cfg(target_arch = "x86_64")] #[test] fn test_rayon_simd_fft() { run_fft_ifft(