pub struct DynamicSlicePlan { /* private fields */ }Expand description
A compiled fixed-window dynamic-slice traversal.
Implementations§
Source§impl DynamicSlicePlan
impl DynamicSlicePlan
Sourcepub fn compile(
operand_dims: &[usize],
operand_strides: &[isize],
start_dims: &[usize],
start_strides: &[isize],
dest_dims: &[usize],
dest_strides: &[isize],
slice_sizes: &[usize],
) -> Result<Self>
pub fn compile( operand_dims: &[usize], operand_strides: &[isize], start_dims: &[usize], start_strides: &[isize], dest_dims: &[usize], dest_strides: &[isize], slice_sizes: &[usize], ) -> Result<Self>
Compile a fixed-window dynamic-slice traversal.
start_* describes a rank-1 index vector whose length equals the
operand rank. dest_dims must equal slice_sizes.
§Errors
Returns StridedError::StrideLengthMismatch when a stride list does
not match its dimension list, StridedError::RankMismatch when
slice_sizes differs from the operand rank or the start layout is not a
rank-1 vector of that same length,
StridedError::OffsetOverflow when an element count or layout span
does not fit usize/isize, StridedError::ShapeMismatch when
dest_dims differs from slice_sizes in extent or rank,
StridedError::NonInjectiveOutputLayout when the destination layout
maps two logical indices onto one offset, and
StridedError::InvalidAxis when a slice size exceeds its operand
extent.
Sourcepub fn execute<T, I>(
&self,
dest: &mut RawStridedMut<'_, T>,
operand: &RawStridedRef<'_, T>,
starts: &RawStridedRef<'_, I>,
exec: Exec<'_>,
) -> Result<()>
pub fn execute<T, I>( &self, dest: &mut RawStridedMut<'_, T>, operand: &RawStridedRef<'_, T>, starts: &RawStridedRef<'_, I>, exec: Exec<'_>, ) -> Result<()>
Execute the prepared dynamic-slice traversal.
§Errors
Returns StridedError::PlanLayoutMismatch when the operand, start,
or destination view does not carry its compiled extents and strides,
before any destination write. Start values are clamped to
operand_dims - slice_sizes, so an out-of-range start is not an
error.
Trait Implementations§
Source§impl Clone for DynamicSlicePlan
impl Clone for DynamicSlicePlan
Auto Trait Implementations§
impl Freeze for DynamicSlicePlan
impl RefUnwindSafe for DynamicSlicePlan
impl Send for DynamicSlicePlan
impl Sync for DynamicSlicePlan
impl Unpin for DynamicSlicePlan
impl UnsafeUnpin for DynamicSlicePlan
impl UnwindSafe for DynamicSlicePlan
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more