pub struct RollPlan<T: Element, const N: usize> { /* private fields */ }Expand description
roll plan.
y = x.roll(shifts, axes) — cyclic shift along axes (PyTorch
torch.roll). Output shape equals input shape.
When to use: forward cyclic shift. Pair with
RollBackwardPlan, which reuses the
FW kernel with negated shifts.
Dtypes: {f32, f64, f16, bf16}. Pure index permutation.
Shape limits: rank in [1, 8]; per-axis shifts can be
negative (kernel normalizes to [0, shape[d])).
Workspace: none.
Precision guarantee: deterministic, bit-stable, bit-exact.
Implementations§
Source§impl<T: Element, const N: usize> RollPlan<T, N>
impl<T: Element, const N: usize> RollPlan<T, N>
Sourcepub fn select(
_stream: &Stream,
desc: &RollDescriptor<N>,
_pref: PlanPreference,
) -> Result<Self>
pub fn select( _stream: &Stream, desc: &RollDescriptor<N>, _pref: PlanPreference, ) -> Result<Self>
Pick a kernel for desc.
Sourcepub fn can_implement(&self, args: &RollArgs<'_, T, N>) -> Result<()>
pub fn can_implement(&self, args: &RollArgs<'_, T, N>) -> Result<()>
Validate args.
Sourcepub fn workspace_size(&self) -> usize
pub fn workspace_size(&self) -> usize
Workspace size in bytes.
Sourcepub fn precision_guarantee(&self) -> PrecisionGuarantee
pub fn precision_guarantee(&self) -> PrecisionGuarantee
Numerical guarantees.
Auto Trait Implementations§
impl<T, const N: usize> Freeze for RollPlan<T, N>
impl<T, const N: usize> RefUnwindSafe for RollPlan<T, N>where
T: RefUnwindSafe,
impl<T, const N: usize> Send for RollPlan<T, N>where
T: Send,
impl<T, const N: usize> Sync for RollPlan<T, N>where
T: Sync,
impl<T, const N: usize> Unpin for RollPlan<T, N>where
T: Unpin,
impl<T, const N: usize> UnsafeUnpin for RollPlan<T, N>
impl<T, const N: usize> UnwindSafe for RollPlan<T, N>where
T: 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