Skip to main content

mnemosyne_arena/scratch/
mod.rs

1//! Temporal aligned scratch pool for high-performance numerical workloads.
2//!
3//! FFT and transform workloads (e.g. Apollo) repeatedly need large, aligned
4//! temporary buffers for Stockham autosort, Bluestein chirp, PFA scratch, and
5//! Rader convolution. These buffers are typically allocated once, grown to the
6//! maximum needed size, and reused across many transform calls.
7//!
8//! Two complementary buffer types cover the full size range:
9//!
10//! | Type | Storage | Heap | Use when |
11//! |------|---------|------|----------|
12//! | [`AlignedVec<T>`] | heap | yes | size unknown at compile time |
13//! | [`AlignedBuf<T, N>`] | stack | **no** | size bounded at compile time |
14
15pub mod aligned_buf;
16pub mod aligned_vec;
17pub mod bank;
18pub mod element;
19pub mod pool;
20
21#[cfg(test)]
22mod tests;
23
24pub use aligned_buf::AlignedBuf;
25pub use aligned_vec::{AlignedVec, Drain, IntoIter};
26pub use bank::ScratchBank;
27pub use element::{DEFAULT_SCRATCH_ALIGN, ScratchElement, default_align};
28pub use pool::{MAX_POOL_SLOTS, ScratchPool};