Skip to content

Commit 51bf0b8

Browse files
committed
Updating documentation
1 parent 60a7dca commit 51bf0b8

File tree

3 files changed

+27
-11
lines changed

3 files changed

+27
-11
lines changed

Cargo.toml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
11
[package]
22
name = "monarch-butterfly"
3-
version = "0.3.0"
3+
version = "0.3.1"
44
edition = "2021"
55
description = "Proc-Macro unrolled FFTs"
66
license = "MIT"
77
documentation = "https://docs.rs/monarch-butterfly"
88
homepage = "https://github.com/michaelciraci/Monarch-Butterfly"
99
repository = "https://github.com/michaelciraci/Monarch-Butterfly"
1010
rust-version = "1.63"
11+
keywords = ["fft", "dft", "discrete", "fourier", "transform"]
12+
categories = ["algorithms", "science"]
1113

1214
[dependencies]
1315
monarch-derive = "=0.3.0"

README.md

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,10 @@
55

66
# Monarch Butterfly
77

8-
Experimental FFT library where all FFTs are proc-macro generated const-evaluation functions. The use case is if you know the FFT size at compile time. However, knowing the FFT size at compile time gives immense gains.
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.
912

1013
This library implements FFTs for both `f32` and `f64` sizes `1-200`. The FFTs are auto-generated so this limit could be increased above 200 at the expense of compile time.
1114

@@ -21,8 +24,16 @@ This library implements FFTs for both `f32` and `f64` sizes `1-200`. The FFTs ar
2124
- FFT size must be known at compile time
2225
- By default, only FFTs up to size 200 are generated
2326

27+
## Comparison
28+
29+
RustFFT and FFTW FFT sizes can be decided at runtime, so comparing against a library whose FFT sizes need to be known at compile time is comparing apples and oranges. With that in mind, knowing the FFT size at compile time does give immense gains.
30+
2431
![log](assets/log_comparison.png)
2532

33+
## Usage
34+
35+
The top level functions are `fft` and `ifft`.
36+
2637
```
2738
use monarch_butterfly::*;
2839
use num_complex::Complex;
@@ -31,8 +42,7 @@ let input: Vec<_> = (0..8).map(|i| Complex::new(i as f32, 0.0)).collect();
3142
let output = fft::<8, _, _>(input);
3243
```
3344

34-
This library will use all SIMD features your CPU has available including AVX512,
35-
assuming you compile with those features (`RUSTFLAGS="-C target-cpu=native" cargo build`).
45+
This library will use all SIMD features your CPU has, assuming `rustc` can compile to those SIMD features.
3646

3747
The larger the FFT sizes, the larger speed boost this library will give you.
3848

src/lib.rs

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,13 @@
55
//!
66
//! # Monarch Butterfly
77
//!
8-
//! Experimental FFT library where all FFTs are proc-macro generated const-evaluation functions. //! The use case is if you know the FFT size at compile time. However, knowing the FFT size at //! compile time gives immense gains.
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.
912
//!
10-
//! This library implements FFTs for both `f32` and `f64` sizes `1-200`. The FFTs are //! auto-generated so this limit could be increased above 200 at the expense of compile time.
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.
1115
//!
1216
//! ## Features
1317
//!
@@ -21,17 +25,17 @@
2125
//! - FFT size must be known at compile time
2226
//! - By default, only FFTs up to size 200 are generated
2327
//!
24-
//!
28+
//! ## Usage
29+
//!
30+
//! The top level functions are [`fft`] and [`ifft`].
31+
//!
2532
//! ```
2633
//! use monarch_butterfly::*;
2734
//! use num_complex::Complex;
2835
//!
2936
//! let input: Vec<_> = (0..8).map(|i| Complex::new(i as f32, 0.0)).collect();
3037
//! let output = fft::<8, _, _>(input);
3138
//! ```
32-
//!
33-
//! The top level functions are [`fft`] and [`ifft`].
34-
//!
3539
//! This library will use all SIMD features your CPU has available including AVX512,
3640
//! assuming you compile with those features (`RUSTFLAGS="-C target-cpu=native" cargo build`).
3741
//!
@@ -40,7 +44,7 @@
4044
//! As an example of AVX512 instructions, here is an example on just an FFT
4145
//! of size 128: <https://godbolt.org/z/Y58eh1x5a>(`Ctrl+F` for "zmm" instructions)
4246
//!
43-
//! The FFTs before unrolling are heavily inspired from [`RustFFT``](<https://github.com/ejmahler/RustFFT>).
47+
//! The FFTs before unrolling are heavily inspired from [`RustFFT`](<https://github.com/ejmahler/RustFFT>).
4448
//! Credit is given to Elliott Mahler as the RustFFT original author.
4549
4650
#![allow(clippy::excessive_precision)]

0 commit comments

Comments
 (0)