pub struct ErasedDynamicUpdateSlicePlan { /* private fields */ }Expand description
Dtype-erased dynamic-update-slice wrapper.
Implementations§
Source§impl ErasedDynamicUpdateSlicePlan
impl ErasedDynamicUpdateSlicePlan
Sourcepub fn compile(
dtype: KernelDType,
index_dtype: KernelDType,
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( dtype: KernelDType, index_dtype: KernelDType, 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>
Validate and store a dynamic-update-slice plan for one value dtype, index dtype, and layout set.
§Errors
Returns StridedError::UnsupportedDType when index_dtype is not
i32/i64, 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 a layout
span does not fit usize/isize, StridedError::ShapeMismatch
when dest_dims differs from operand_dims,
StridedError::NonInjectiveOutputLayout when the destination layout
cannot be proven injective, and StridedError::InvalidAxis when
an update extent exceeds its operand extent.
pub fn dtype(&self) -> KernelDType
pub fn index_dtype(&self) -> KernelDType
pub fn plan(&self) -> &DynamicUpdateSlicePlan
Sourcepub fn execute(
&self,
dest: &mut ErasedRawStridedMut<'_>,
operand: &ErasedRawStridedRef<'_>,
update: &ErasedRawStridedRef<'_>,
starts: &ErasedRawStridedRef<'_>,
exec: Exec<'_>,
) -> Result<()>
pub fn execute( &self, dest: &mut ErasedRawStridedMut<'_>, operand: &ErasedRawStridedRef<'_>, update: &ErasedRawStridedRef<'_>, starts: &ErasedRawStridedRef<'_>, exec: Exec<'_>, ) -> Result<()>
Execute a dynamic update slice into an erased output descriptor.
§Errors
Returns StridedError::DTypeMismatch when dest, operand,
update, or starts does not carry its compiled dtype, and
StridedError::PlanLayoutMismatch when a view does not carry its
compiled extents and strides. Starts are clamped to
operand_dims - update_dims, so an out-of-range start is not an
error, and the operand copy rejects everything above before it runs.
Sourcepub fn execute_uninit(
&self,
dest: &mut ErasedRawStridedUninitMut<'_>,
operand: &ErasedRawStridedPtr<'_>,
update: &ErasedRawStridedPtr<'_>,
starts: &ErasedRawStridedPtr<'_>,
exec: Exec<'_>,
) -> Result<()>
pub fn execute_uninit( &self, dest: &mut ErasedRawStridedUninitMut<'_>, operand: &ErasedRawStridedPtr<'_>, update: &ErasedRawStridedPtr<'_>, starts: &ErasedRawStridedPtr<'_>, exec: Exec<'_>, ) -> Result<()>
On success, the copy phase initializes every reachable destination slot before the read-modify-write phase. Unreachable holes are neither read nor initialized. Validation errors before the copy leave the destination untouched; an error or panic after the copy may leave a mixture of old and new reachable values, all initialized and safely droppable.
§Errors
Returns StridedError::DTypeMismatch when dest, operand,
update, or starts does not carry its compiled dtype,
StridedError::OverlappingInputOutput when an input allocation
overlaps the destination, StridedError::InvalidBoolByte when a
bool operand or update holds a byte other than 0 or 1,
StridedError::PlanLayoutMismatch when a view does not carry its
compiled extents and strides. Every rejection above is returned before
the operand copy runs.
Trait Implementations§
Source§impl Clone for ErasedDynamicUpdateSlicePlan
impl Clone for ErasedDynamicUpdateSlicePlan
Auto Trait Implementations§
impl Freeze for ErasedDynamicUpdateSlicePlan
impl RefUnwindSafe for ErasedDynamicUpdateSlicePlan
impl Send for ErasedDynamicUpdateSlicePlan
impl Sync for ErasedDynamicUpdateSlicePlan
impl Unpin for ErasedDynamicUpdateSlicePlan
impl UnsafeUnpin for ErasedDynamicUpdateSlicePlan
impl UnwindSafe for ErasedDynamicUpdateSlicePlan
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