|
1 | | -//! [](https://github.com/michaelciraci/Monarch-Butterfly/actions/workflows/rust.yml) |
2 | | -//! [](https://github.com/rust-secure-code/safety-dance/) |
3 | | -//! [](https://img.shields.io/crates/v/monarch-butterfly) |
4 | | -//! [](https://docs.rs/monarch-butterfly/) |
5 | | -//! |
6 | | -//! # Monarch Butterfly |
7 | | -//! |
8 | | -//! Experimental FFT library where all FFTs are proc-macro generated const-evaluation functions. |
9 | | -//! The one requirement is you must know the size of the FFT at compile-time. Knowing the FFT size at |
10 | | -//! compile time gives immense gains, as the compiler is able unroll the call stack and optimize for |
11 | | -//! SIMD throughput through function calls. |
12 | | -//! |
13 | | -//! This library implements FFTs for both `f32` and `f64` sizes `1-200`. The FFTs are |
14 | | -//! auto-generated so this limit could be increased above 200 at the expense of compile time. |
15 | | -//! |
16 | | -//! ## Features |
17 | | -//! |
18 | | -//! - All functions are auto-generated with proc-macros with unrolled loops |
19 | | -//! - Zero `unsafe` code |
20 | | -//! - Completely portable |
21 | | -//! - Const-evaluation functions |
22 | | -//! |
23 | | -//! ## Limitations |
24 | | -//! |
25 | | -//! - FFT size must be known at compile time |
26 | | -//! - By default, only FFTs up to size 200 are generated |
27 | | -//! |
28 | | -//! ## Usage |
29 | | -//! |
30 | | -//! The top level functions are [`fft`] and [`ifft`]. |
31 | | -//! |
32 | | -//! ``` |
33 | | -//! use monarch_butterfly::*; |
34 | | -//! use num_complex::Complex; |
35 | | -//! |
36 | | -//! let input: Vec<_> = (0..8).map(|i| Complex::new(i as f32, 0.0)).collect(); |
37 | | -//! let output = fft::<8, _, _>(input); |
38 | | -//! ``` |
39 | | -//! This library will use all SIMD features your CPU has available including AVX512, |
40 | | -//! assuming you compile with those features (`RUSTFLAGS="-C target-cpu=native" cargo build`). |
41 | | -//! |
42 | | -//! The larger the FFT sizes, the larger speed boost this library will give you. |
43 | | -//! |
44 | | -//! As an example of AVX512 instructions, here is an example on just an FFT |
45 | | -//! of size 128: <https://godbolt.org/z/Y58eh1x5a>(`Ctrl+F` for "zmm" instructions) |
46 | | -//! |
47 | | -//! The FFTs before unrolling are heavily inspired from [`RustFFT`](<https://github.com/ejmahler/RustFFT>). |
48 | | -//! Credit is given to Elliott Mahler as the RustFFT original author. |
| 1 | +#![doc = include_str!("../README.md")] |
49 | 2 |
|
50 | 3 | #![allow(clippy::excessive_precision)] |
51 | 4 | #![forbid(unsafe_code)] |
|
0 commit comments