Skip to main content

ErasedConcatenatePlan

Struct ErasedConcatenatePlan 

Source
pub struct ErasedConcatenatePlan { /* private fields */ }
Expand description

Dtype-erased concatenate wrapper.

Implementations§

Source§

impl ErasedConcatenatePlan

Source

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.

Source

pub fn dtype(&self) -> KernelDType

Source

pub fn plan(&self) -> &ConcatenatePlan

Source

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.

Source

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

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for ErasedConcatenatePlan

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.