pub struct ErasedCopyPlan { /* private fields */ }Expand description
Dtype-erased wrapper around CopyPlan.
Implementations§
Source§impl ErasedCopyPlan
impl ErasedCopyPlan
Sourcepub fn compile(
dtype: KernelDType,
dims: &[usize],
dst_strides: &[isize],
src_strides: &[isize],
) -> Result<Self>
pub fn compile( dtype: KernelDType, dims: &[usize], dst_strides: &[isize], src_strides: &[isize], ) -> Result<Self>
Compile a copy plan for one dtype and layout pair.
§Errors
Returns StridedError::StrideLengthMismatch when dims,
dst_strides, and src_strides do not all have the same length,
StridedError::OffsetOverflow when the element count does not fit
usize, and StridedError::NonInjectiveOutputLayout when the
destination layout cannot be proven injective (aliasing elements, or a
span the check cannot represent). The dtype
is only stored here; execute checks it.
pub fn dtype(&self) -> KernelDType
Sourcepub fn execute(
&self,
dest: &mut ErasedRawStridedMut<'_>,
src: &ErasedRawStridedRef<'_>,
exec: Exec<'_>,
) -> Result<()>
pub fn execute( &self, dest: &mut ErasedRawStridedMut<'_>, src: &ErasedRawStridedRef<'_>, exec: Exec<'_>, ) -> Result<()>
dest = src through a non-generic dtype-erased replay boundary.
§Errors
Returns StridedError::DTypeMismatch when dest or src carries a
different dtype than the plan, and
StridedError::PlanLayoutMismatch when a view does not carry the
compiled extents and strides. Nothing is written unless every check
succeeds.
Trait Implementations§
Source§impl Clone for ErasedCopyPlan
impl Clone for ErasedCopyPlan
Auto Trait Implementations§
impl Freeze for ErasedCopyPlan
impl RefUnwindSafe for ErasedCopyPlan
impl Send for ErasedCopyPlan
impl Sync for ErasedCopyPlan
impl Unpin for ErasedCopyPlan
impl UnsafeUnpin for ErasedCopyPlan
impl UnwindSafe for ErasedCopyPlan
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