pub struct ErasedPadPlan { /* private fields */ }Expand description
Dtype-erased pad wrapper.
Implementations§
Source§impl ErasedPadPlan
impl ErasedPadPlan
Sourcepub fn compile(
dtype: KernelDType,
operand_dims: &[usize],
operand_strides: &[isize],
dest_dims: &[usize],
dest_strides: &[isize],
edge_padding_low: &[i64],
edge_padding_high: &[i64],
interior_padding: &[i64],
) -> Result<Self>
pub fn compile( dtype: KernelDType, operand_dims: &[usize], operand_strides: &[isize], dest_dims: &[usize], dest_strides: &[isize], edge_padding_low: &[i64], edge_padding_high: &[i64], interior_padding: &[i64], ) -> Result<Self>
Validate and store a pad plan for one dtype and fixed layout set.
pub fn dtype(&self) -> KernelDType
pub fn plan(&self) -> &PadPlan
Sourcepub fn execute(
&self,
ctx: &ExecContext,
dest: &mut ErasedRawStridedMut<'_>,
operand: &ErasedRawStridedRef<'_>,
fill: &[u8],
) -> Result<()>
pub fn execute( &self, ctx: &ExecContext, dest: &mut ErasedRawStridedMut<'_>, operand: &ErasedRawStridedRef<'_>, fill: &[u8], ) -> Result<()>
Execute pad into an erased output descriptor using one dtype scalar as fill.
Sourcepub fn execute_uninit(
&self,
ctx: &ExecContext,
dest: &mut ErasedRawStridedUninitMut<'_>,
operand: &ErasedRawStridedPtr<'_>,
fill: &[u8],
) -> Result<()>
pub fn execute_uninit( &self, ctx: &ExecContext, dest: &mut ErasedRawStridedUninitMut<'_>, operand: &ErasedRawStridedPtr<'_>, fill: &[u8], ) -> Result<()>
Execute pad 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.
Trait Implementations§
Source§impl Clone for ErasedPadPlan
impl Clone for ErasedPadPlan
Source§fn clone(&self) -> ErasedPadPlan
fn clone(&self) -> ErasedPadPlan
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for ErasedPadPlan
impl RefUnwindSafe for ErasedPadPlan
impl Send for ErasedPadPlan
impl Sync for ErasedPadPlan
impl Unpin for ErasedPadPlan
impl UnsafeUnpin for ErasedPadPlan
impl UnwindSafe for ErasedPadPlan
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
Mutably borrows from an owned value. Read more