1#![allow(clippy::similar_names)] #![allow(clippy::many_single_char_names)] #![allow(clippy::cast_precision_loss)] #![allow(clippy::cast_sign_loss)] #![allow(clippy::cast_possible_wrap)] #![allow(clippy::missing_panics_doc)] #![allow(clippy::must_use_candidate)] #![allow(clippy::missing_const_for_fn)] #![allow(clippy::doc_markdown)] #![allow(clippy::return_self_not_must_use)] #![allow(clippy::incompatible_msrv)] #![allow(clippy::assign_op_pattern)] #![allow(clippy::needless_range_loop)] #![allow(clippy::wildcard_imports)] #![allow(clippy::unused_self)] #![allow(clippy::too_many_arguments)] #![allow(clippy::redundant_closure_for_method_calls)] #![allow(clippy::ptr_as_ptr)] #![allow(clippy::fn_to_numeric_cast)] #![allow(clippy::suboptimal_flops)] #![allow(clippy::manual_is_power_of_two)] #![allow(clippy::if_then_some_else_none)] #![allow(clippy::imprecise_flops)] #![allow(clippy::not_unsafe_ptr_arg_deref)] #![allow(clippy::derivable_impls)] #![allow(clippy::ptr_eq)] #![allow(clippy::use_self)] #![allow(clippy::unnecessary_wraps)] #![allow(clippy::too_many_lines)] #![allow(clippy::trivially_copy_pass_by_ref)] #![allow(clippy::panic_in_result_fn)] #![allow(clippy::match_same_arms)] #![allow(clippy::suspicious_arithmetic_impl)] #![allow(clippy::only_used_in_recursion)] #![allow(clippy::manual_div_ceil)] #![allow(clippy::float_cmp)] #![allow(clippy::cast_possible_truncation)] #![allow(clippy::if_not_else)] #![allow(clippy::manual_assert)] #![allow(clippy::useless_let_if_seq)] #![allow(clippy::ptr_cast_constness)] #![allow(clippy::derive_partial_eq_without_eq)] #![allow(clippy::format_push_string)] #![allow(clippy::redundant_closure)] #![allow(clippy::significant_drop_tightening)] #![allow(clippy::explicit_iter_loop)] #![allow(clippy::unreadable_literal)] #![allow(clippy::missing_errors_doc)] #![allow(clippy::manual_let_else)] #![allow(clippy::type_complexity)] #![allow(clippy::needless_pass_by_value)] #![allow(clippy::option_if_let_else)] #![allow(clippy::struct_field_names)] #![allow(clippy::duplicate_mod)] #![allow(clippy::suspicious_operation_groupings)] #![allow(clippy::verbose_bit_mask)] #![allow(clippy::type_repetition_in_bounds)] #![allow(clippy::no_effect_underscore_binding)] #![allow(clippy::manual_clamp)] #![allow(clippy::used_underscore_binding)] #![cfg_attr(not(feature = "std"), no_std)]
91#![cfg_attr(feature = "portable_simd", feature(portable_simd))]
92
93#[cfg(not(feature = "std"))]
94extern crate alloc;
95
96pub(crate) mod prelude;
98
99pub mod api;
100#[cfg(feature = "const-fft")]
101pub mod const_fft;
102pub mod dft;
103#[cfg(any(feature = "gpu", feature = "cuda", feature = "metal"))]
104pub mod gpu;
105pub mod kernel;
106#[cfg(feature = "mpi")]
107pub mod mpi;
108#[cfg(feature = "pruned")]
109pub mod pruned;
110pub mod rdft;
111pub mod reodft;
112pub mod simd;
113#[cfg(feature = "sparse")]
114pub mod sparse;
115#[cfg(feature = "streaming")]
116pub mod streaming;
117pub mod support;
118pub mod threading;
119#[cfg(feature = "wasm")]
120pub mod wasm;
121
122pub mod autodiff;
124pub mod conv;
125#[cfg(feature = "std")]
126pub mod frft;
127#[cfg(feature = "std")]
128pub mod nufft;
129
130pub use api::{
132 fft, fft2d, fft2d_split, fft3d_split, fft_batch, fft_nd, fft_nd_split, fft_split, ifft, ifft2d,
133 ifft2d_split, ifft3d_split, ifft_batch, ifft_nd, ifft_nd_split, ifft_split, irfft, irfft2d,
134 irfft3d, irfft_batch, irfft_nd, rfft, rfft2d, rfft3d, rfft_batch, rfft_nd, Direction, Flags,
135 GuruPlan, Plan, Plan2D, Plan3D, PlanND, R2rKind, R2rPlan, RealPlan, RealPlan2D, RealPlan3D,
136 RealPlanKind, RealPlanND, SplitPlan, SplitPlan2D, SplitPlan3D, SplitPlanND,
137};
138pub use kernel::{Complex, Float, IoDim, Tensor};
139
140#[cfg(feature = "f128-support")]
142pub use kernel::F128;
143
144#[cfg(feature = "f16-support")]
146pub use kernel::F16;
147
148#[cfg(feature = "sparse")]
150pub use sparse::{sparse_fft, sparse_ifft, SparsePlan, SparseResult};
151
152#[cfg(feature = "pruned")]
154pub use pruned::{
155 fft_pruned_input, fft_pruned_output, goertzel, goertzel_multi, PrunedPlan, PruningMode,
156};
157
158#[cfg(feature = "wasm")]
160pub use wasm::{fft_f32, fft_f64, ifft_f32, ifft_f64, rfft_f64, WasmFft, WasmSimdF32, WasmSimdF64};
161
162#[cfg(feature = "streaming")]
164pub use streaming::{
165 blackman, cola_normalization, hamming, hann, istft, kaiser, magnitude_spectrogram,
166 phase_spectrogram, power_spectrogram, rectangular, stft, RingBuffer, StreamingFft,
167 WindowFunction,
168};
169
170#[cfg(feature = "const-fft")]
172pub use const_fft::{
173 const_cos, const_sin, fft_fixed, fft_fixed_inplace, ifft_fixed, ifft_fixed_inplace,
174 twiddle_factor, ConstFft, ConstFftImpl,
175};
176
177#[cfg(any(feature = "gpu", feature = "cuda", feature = "metal"))]
179pub use gpu::{
180 best_backend, is_gpu_available, query_capabilities, GpuBackend, GpuBuffer, GpuCapabilities,
181 GpuDirection, GpuError, GpuFft, GpuFftEngine, GpuPlan, GpuResult,
182};
183
184pub use dft::solvers::{
186 ct::{
187 fft_radix2, fft_radix2_inplace, ifft_radix2, ifft_radix2_inplace, ifft_radix2_normalized,
188 },
189 direct::{dft_direct, idft_direct, idft_direct_normalized},
190 nop::dft_nop,
191};
192
193pub use rdft::solvers::{dct1, dct2, dct3, dct4, dht, dst1, dst2, dst3, dst4};
195
196pub use api::{
198 alloc_complex, alloc_complex_aligned, alloc_real, alloc_real_aligned, is_aligned,
199 AlignedBuffer, DEFAULT_ALIGNMENT,
200};
201
202#[cfg(feature = "std")]
204pub use nufft::{
205 nufft_type1, nufft_type2, nufft_type3, Nufft, NufftError, NufftOptions, NufftResult, NufftType,
206};
207
208#[cfg(feature = "std")]
210pub use frft::{frft, frft_checked, ifrft, ifrft_checked, Frft, FrftError, FrftResult};
211
212pub use conv::{
214 convolve, convolve_circular, convolve_complex, convolve_complex_mode, convolve_mode,
215 convolve_with_mode, correlate, correlate_complex, correlate_complex_mode, correlate_mode,
216 polynomial_multiply, polynomial_multiply_complex, polynomial_power, ConvMode,
217};
218
219pub use autodiff::{
221 fft_dual, fft_jacobian, grad_fft, grad_ifft, jvp_fft, vjp_fft, DiffFftPlan, Dual, DualComplex,
222};