pub struct DynamicUpdateSlicePlan { /* private fields */ }Expand description
A compiled dynamic-update-slice traversal.
Execution first copies operand into dest, then overwrites the clamped
update window. The plan performs no allocation for ranks at most
RAW_FUSED_RANK_LIMIT.
Implementations§
Source§impl DynamicUpdateSlicePlan
impl DynamicUpdateSlicePlan
Sourcepub fn compile(
operand_dims: &[usize],
operand_strides: &[isize],
start_dims: &[usize],
start_strides: &[isize],
update_dims: &[usize],
update_strides: &[isize],
dest_dims: &[usize],
dest_strides: &[isize],
) -> Result<DynamicUpdateSlicePlan, StridedError>
pub fn compile( operand_dims: &[usize], operand_strides: &[isize], start_dims: &[usize], start_strides: &[isize], update_dims: &[usize], update_strides: &[isize], dest_dims: &[usize], dest_strides: &[isize], ) -> Result<DynamicUpdateSlicePlan, StridedError>
Compile a dynamic-update-slice traversal.
dest_dims must match operand_dims; execution materializes
dest = operand and then overwrites the clamped update window.
§Errors
Returns StridedError::StrideLengthMismatch when a stride list does
not match its dimension list, StridedError::RankMismatch when
update_dims 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 operand_dims in extent or rank,
StridedError::NonInjectiveOutputLayout when the destination layout
maps two logical indices onto one offset, and
StridedError::InvalidAxis when an update extent exceeds its
operand extent.
Sourcepub fn execute<T, I>(
&self,
dest: &mut RawStridedMut<'_, T>,
operand: &RawStridedRef<'_, T>,
update: &RawStridedRef<'_, T>,
starts: &RawStridedRef<'_, I>,
exec: Exec<'_>,
) -> Result<(), StridedError>
pub fn execute<T, I>( &self, dest: &mut RawStridedMut<'_, T>, operand: &RawStridedRef<'_, T>, update: &RawStridedRef<'_, T>, starts: &RawStridedRef<'_, I>, exec: Exec<'_>, ) -> Result<(), StridedError>
Execute the prepared dynamic-update-slice traversal.
§Errors
Returns StridedError::PlanLayoutMismatch when the operand, update,
start, or destination view does not carry its compiled extents and
strides, and StridedError::OffsetOverflow when the checked update
window does not fit isize. Both are decided before the operand copy
runs, so a failed call leaves dest unmodified. Start values are
clamped to operand_dims - update_dims, so an out-of-range start is
not an error.
Trait Implementations§
Source§impl Clone for DynamicUpdateSlicePlan
impl Clone for DynamicUpdateSlicePlan
Source§fn clone(&self) -> DynamicUpdateSlicePlan
fn clone(&self) -> DynamicUpdateSlicePlan
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for DynamicUpdateSlicePlan
impl RefUnwindSafe for DynamicUpdateSlicePlan
impl Send for DynamicUpdateSlicePlan
impl Sync for DynamicUpdateSlicePlan
impl Unpin for DynamicUpdateSlicePlan
impl UnsafeUnpin for DynamicUpdateSlicePlan
impl UnwindSafe for DynamicUpdateSlicePlan
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