pub struct ErasedDynamicSlicePlan { /* private fields */ }Expand description
Dtype-erased fixed-window dynamic-slice wrapper.
Implementations§
Source§impl ErasedDynamicSlicePlan
impl ErasedDynamicSlicePlan
Sourcepub fn compile(
dtype: KernelDType,
index_dtype: KernelDType,
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( dtype: KernelDType, index_dtype: KernelDType, operand_dims: &[usize], operand_strides: &[isize], start_dims: &[usize], start_strides: &[isize], dest_dims: &[usize], dest_strides: &[isize], slice_sizes: &[usize], ) -> Result<Self>
Validate and store a dynamic-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
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 a layout
span does not fit usize/isize, StridedError::ShapeMismatch
when dest_dims differs from slice_sizes,
StridedError::NonInjectiveOutputLayout when the destination layout
cannot be proven injective, and StridedError::InvalidAxis when a
slice size exceeds its operand extent.
pub fn dtype(&self) -> KernelDType
pub fn index_dtype(&self) -> KernelDType
pub fn plan(&self) -> &DynamicSlicePlan
Sourcepub fn execute(
&self,
dest: &mut ErasedRawStridedMut<'_>,
operand: &ErasedRawStridedRef<'_>,
starts: &ErasedRawStridedRef<'_>,
exec: Exec<'_>,
) -> Result<()>
pub fn execute( &self, dest: &mut ErasedRawStridedMut<'_>, operand: &ErasedRawStridedRef<'_>, starts: &ErasedRawStridedRef<'_>, exec: Exec<'_>, ) -> Result<()>
Execute a fixed-window dynamic slice into an erased output descriptor.
§Errors
Returns StridedError::DTypeMismatch when dest, operand, 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 - slice_sizes, so an out-of-range start is not an error, and nothing is
written unless every check succeeds.
Sourcepub fn execute_uninit(
&self,
dest: &mut ErasedRawStridedUninitMut<'_>,
operand: &ErasedRawStridedPtr<'_>,
starts: &ErasedRawStridedPtr<'_>,
exec: Exec<'_>,
) -> Result<()>
pub fn execute_uninit( &self, dest: &mut ErasedRawStridedUninitMut<'_>, operand: &ErasedRawStridedPtr<'_>, starts: &ErasedRawStridedPtr<'_>, exec: Exec<'_>, ) -> Result<()>
Execute dynamic slice into a destination whose reachable slots may be
uninitialized.
On success, every reachable destination slot is fully overwritten;
unreachable holes are neither read nor initialized. Validation errors
are returned before any destination write. A panic during execution may
leave reachable slots partially initialized, but the MaybeUninit
destination remains safely droppable.
§Errors
Returns StridedError::DTypeMismatch when dest, operand, or
starts does not carry its compiled dtype,
StridedError::OverlappingInputOutput when an input allocation
overlaps the destination, StridedError::InvalidBoolByte when a
bool operand 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
any destination write.
Trait Implementations§
Source§impl Clone for ErasedDynamicSlicePlan
impl Clone for ErasedDynamicSlicePlan
Auto Trait Implementations§
impl Freeze for ErasedDynamicSlicePlan
impl RefUnwindSafe for ErasedDynamicSlicePlan
impl Send for ErasedDynamicSlicePlan
impl Sync for ErasedDynamicSlicePlan
impl Unpin for ErasedDynamicSlicePlan
impl UnsafeUnpin for ErasedDynamicSlicePlan
impl UnwindSafe for ErasedDynamicSlicePlan
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