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<Self>
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<Self>
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<()>
pub fn execute<T, I>( &self, dest: &mut RawStridedMut<'_, T>, operand: &RawStridedRef<'_, T>, update: &RawStridedRef<'_, T>, starts: &RawStridedRef<'_, I>, exec: Exec<'_>, ) -> Result<()>
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.