pub struct ErasedConcatenatePlan { /* private fields */ }Expand description
Dtype-erased concatenate wrapper.
Implementations§
Source§impl ErasedConcatenatePlan
impl ErasedConcatenatePlan
Sourcepub fn compile(
dtype: KernelDType,
input_dims: &[&[usize]],
input_strides: &[&[isize]],
dest_dims: &[usize],
dest_strides: &[isize],
axis: usize,
) -> Result<Self>
pub fn compile( dtype: KernelDType, input_dims: &[&[usize]], input_strides: &[&[isize]], dest_dims: &[usize], dest_strides: &[isize], axis: usize, ) -> Result<Self>
Validate and store a concatenate plan for one dtype and fixed layout set.
§Errors
Returns StridedError::UnsupportedArity when no input is given,
StridedError::RankMismatch when
input_dims and input_strides list different numbers of layouts or
an input rank differs from the first input’s rank,
StridedError::StrideLengthMismatch when a stride list does not
match its dimension list, StridedError::InvalidAxis when axis is
outside the rank, StridedError::ShapeMismatch when a
non-concatenated extent differs or the destination is not the
concatenation of the inputs,
StridedError::NonInjectiveOutputLayout when the destination layout
maps two logical indices onto one offset, and
StridedError::OffsetOverflow when a segment length or base offset
cannot be represented.
pub fn dtype(&self) -> KernelDType
pub fn plan(&self) -> &ConcatenatePlan
Sourcepub fn execute(
&self,
dest: &mut ErasedRawStridedMut<'_>,
inputs: &[ErasedRawStridedRef<'_>],
exec: Exec<'_>,
) -> Result<()>
pub fn execute( &self, dest: &mut ErasedRawStridedMut<'_>, inputs: &[ErasedRawStridedRef<'_>], exec: Exec<'_>, ) -> Result<()>
Execute concatenate into an erased output descriptor.
§Errors
Returns StridedError::DTypeMismatch when the destination or any
input carries a different dtype than the plan,
StridedError::RankMismatch when the number of inputs differs from
the compiled one, StridedError::PlanLayoutMismatch when the
destination or an input does not carry its compiled extents and
strides, and StridedError::OffsetOverflow when a segment’s
destination offset cannot be expressed in isize. Every check runs
before the first segment is written.
Sourcepub fn execute_uninit(
&self,
dest: &mut ErasedRawStridedUninitMut<'_>,
inputs: &[ErasedRawStridedPtr<'_>],
exec: Exec<'_>,
) -> Result<()>
pub fn execute_uninit( &self, dest: &mut ErasedRawStridedUninitMut<'_>, inputs: &[ErasedRawStridedPtr<'_>], exec: Exec<'_>, ) -> Result<()>
Execute concatenate as a full overwrite of uninitialized output storage.
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 a partially initialized MaybeUninit destination, which is
still safely droppable; no readable value is promised for unwritten
reachable slots.
§Errors
Returns StridedError::DTypeMismatch when the destination or any
input carries a different dtype than the plan,
StridedError::RankMismatch when the number of inputs differs from
the compiled one, StridedError::OverlappingInputOutput when an
input allocation overlaps the destination,
StridedError::InvalidBoolByte when bool input bytes are not 0 or
1, StridedError::PlanLayoutMismatch when the destination or an
input does not carry its compiled extents and strides, and
StridedError::OffsetOverflow when a segment’s destination offset
cannot be expressed in isize. Everything above is returned before any
destination write.
Trait Implementations§
Source§impl Clone for ErasedConcatenatePlan
impl Clone for ErasedConcatenatePlan
Auto Trait Implementations§
impl Freeze for ErasedConcatenatePlan
impl RefUnwindSafe for ErasedConcatenatePlan
impl Send for ErasedConcatenatePlan
impl Sync for ErasedConcatenatePlan
impl Unpin for ErasedConcatenatePlan
impl UnsafeUnpin for ErasedConcatenatePlan
impl UnwindSafe for ErasedConcatenatePlan
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