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.