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.