pub struct RealFftPlan<R: Runtime> { /* private fields */ }Expand description
Reusable exact-length F32 FFT plan. The direction and N are fixed; batches may change, in which case the batched workspace is replaced, not grown without bound. Caller-owned output bindings must be non-overlapping. Raw bindings carry no dtype/device tag: pass F32 storage from this client.
Implementations§
Source§impl<R: Runtime> RealFftPlan<R>
impl<R: Runtime> RealFftPlan<R>
pub fn new( client: ComputeClient<R>, n: usize, mode: FftMode, ) -> Result<Self, LaunchError>
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
pub fn convolution_len(&self) -> Option<usize>
Sourcepub fn retained_bytes(&self) -> usize
pub fn retained_bytes(&self) -> usize
Bytes retained by this plan, excluding output tensors, driver metadata, compiled kernels and temporary initialization scratch.
Sourcepub fn clear_workspace(&mut self)
pub fn clear_workspace(&mut self)
Release scratch; chirp tables remain reusable. Runtime stream ordering handles deferred release. This is not a device-wide synchronization.
Sourcepub fn forward(
&mut self,
signal: TensorBinding<R>,
real: TensorBinding<R>,
imag: TensorBinding<R>,
dim: usize,
used: usize,
) -> Result<(), LaunchError>
pub fn forward( &mut self, signal: TensorBinding<R>, real: TensorBinding<R>, imag: TensorBinding<R>, dim: usize, used: usize, ) -> Result<(), LaunchError>
Unnormalized N-point RFFT. Samples at used..N are zero, without
constructing a padded input tensor. used may be zero.
Sourcepub fn inverse(
&mut self,
real: TensorBinding<R>,
imag: TensorBinding<R>,
signal: TensorBinding<R>,
dim: usize,
used: usize,
) -> Result<(), LaunchError>
pub fn inverse( &mut self, real: TensorBinding<R>, imag: TensorBinding<R>, signal: TensorBinding<R>, dim: usize, used: usize, ) -> Result<(), LaunchError>
N-point IRFFT normalized by 1/N. DC, and Nyquist for even N, are
real-only. Bins at used..N/2+1 are treated as zero.