pub struct Lanes<C>(/* private fields */);Expand description
Multiple lanes with one shared configuration and separate states.
Lanes is the main reason the split-state API exists: immutable
configuration is stored once while each lane keeps its own mutable state.
Scalar processing is lane-wise over [X; N].
For view processing, pair it with View<_, _, LaneMajor, _> when the
natural memory layout is lane-major and the inner stage benefits from long
contiguous per-lane slices. Prefer this over repeat() when all lanes
should use exactly the same configuration.
§Examples
use dsp_process::{LaneMajor, Offset, Split, View, ViewMut, ViewProcess};
let mut p = Split::stateless(Offset(3)).lanes::<2>();
let x = View::<_, LaneMajor, 2>::from_flat(&[1, 2, 3, 10, 20, 30], 3);
let mut y = [0; 6];
let yv = ViewMut::<_, LaneMajor, 2>::from_flat(&mut y, 3);
ViewProcess::process_view(&mut p, x, yv);
assert_eq!(y, [4, 5, 6, 13, 23, 33]);Implementations§
Trait Implementations§
impl<C: Copy> Copy for Lanes<C>
Source§impl<X, C, S> SplitInplace<X, S> for Lanes<C>where
X: Copy,
Self: SplitProcess<X, X, S>,
impl<X, C, S> SplitInplace<X, S> for Lanes<C>where
X: Copy,
Self: SplitProcess<X, X, S>,
Source§impl<X: Copy, Y, C, S, const N: usize> SplitProcess<[X; N], [Y; N], [S; N]> for Lanes<C>where
C: SplitProcess<X, Y, S>,
Process data from multiple lanes with a common configuration.
impl<X: Copy, Y, C, S, const N: usize> SplitProcess<[X; N], [Y; N], [S; N]> for Lanes<C>where
C: SplitProcess<X, Y, S>,
Process data from multiple lanes with a common configuration.
For layout-sensitive view processing use View<_, _, LaneMajor, _>.
Source§impl<'a, X: Copy, C, S, const N: usize> SplitViewInplace<ViewMut<'a, X, LaneMajor, N>, [S; N]> for Lanes<C>where
C: SplitInplace<X, S>,
impl<'a, X: Copy, C, S, const N: usize> SplitViewInplace<ViewMut<'a, X, LaneMajor, N>, [S; N]> for Lanes<C>where
C: SplitInplace<X, S>,
Auto Trait Implementations§
impl<C> Freeze for Lanes<C>where
C: Freeze,
impl<C> RefUnwindSafe for Lanes<C>where
C: RefUnwindSafe,
impl<C> Send for Lanes<C>where
C: Send,
impl<C> Sync for Lanes<C>where
C: Sync,
impl<C> Unpin for Lanes<C>where
C: Unpin,
impl<C> UnsafeUnpin for Lanes<C>where
C: UnsafeUnpin,
impl<C> UnwindSafe for Lanes<C>where
C: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<'a, X, S, T, const L: usize> SplitViewInplace<ViewMut<'a, X, FrameMajor, L>, S> for T
impl<'a, X, S, T, const L: usize> SplitViewInplace<ViewMut<'a, X, FrameMajor, L>, S> for T
Source§fn inplace_view(&self, state: &mut S, xy: ViewMut<'a, X, FrameMajor, L>)
fn inplace_view(&self, state: &mut S, xy: ViewMut<'a, X, FrameMajor, L>)
Process one typed view in place.
Source§impl<'a, 'b, X, Y, S, T, const L: usize> SplitViewProcess<View<'a, X, FrameMajor, L>, ViewMut<'b, Y, FrameMajor, L>, S> for T
impl<'a, 'b, X, Y, S, T, const L: usize> SplitViewProcess<View<'a, X, FrameMajor, L>, ViewMut<'b, Y, FrameMajor, L>, S> for T
Source§fn process_view(
&self,
state: &mut S,
x: View<'a, X, FrameMajor, L>,
y: ViewMut<'b, Y, FrameMajor, L>,
)
fn process_view( &self, state: &mut S, x: View<'a, X, FrameMajor, L>, y: ViewMut<'b, Y, FrameMajor, L>, )
Process one typed input view into one typed output view.