pub struct ErasedScatterPlan { /* private fields */ }Expand description
Dtype-erased additive scatter wrapper.
Implementations§
Source§impl ErasedScatterPlan
impl ErasedScatterPlan
Sourcepub fn compile(
dtype: KernelDType,
index_dtype: KernelDType,
operand_dims: &[usize],
operand_strides: &[isize],
index_dims: &[usize],
index_strides: &[isize],
update_dims: &[usize],
update_strides: &[isize],
dest_dims: &[usize],
dest_strides: &[isize],
spec: ScatterSpec,
) -> Result<Self>
pub fn compile( dtype: KernelDType, index_dtype: KernelDType, operand_dims: &[usize], operand_strides: &[isize], index_dims: &[usize], index_strides: &[isize], update_dims: &[usize], update_strides: &[isize], dest_dims: &[usize], dest_strides: &[isize], spec: ScatterSpec, ) -> Result<Self>
Validate and store an additive scatter plan for one value dtype, index dtype, and layout set.
pub fn dtype(&self) -> KernelDType
pub fn index_dtype(&self) -> KernelDType
pub fn plan(&self) -> &ScatterPlan
Sourcepub fn execute(
&self,
ctx: &ExecContext,
dest: &mut ErasedRawStridedMut<'_>,
operand: &ErasedRawStridedRef<'_>,
scatter_indices: &ErasedRawStridedRef<'_>,
updates: &ErasedRawStridedRef<'_>,
) -> Result<()>
pub fn execute( &self, ctx: &ExecContext, dest: &mut ErasedRawStridedMut<'_>, operand: &ErasedRawStridedRef<'_>, scatter_indices: &ErasedRawStridedRef<'_>, updates: &ErasedRawStridedRef<'_>, ) -> Result<()>
Execute additive scatter into an erased output descriptor.
Sourcepub fn execute_uninit(
&self,
ctx: &ExecContext,
dest: &mut ErasedRawStridedUninitMut<'_>,
operand: &ErasedRawStridedPtr<'_>,
scatter_indices: &ErasedRawStridedPtr<'_>,
updates: &ErasedRawStridedPtr<'_>,
) -> Result<()>
pub fn execute_uninit( &self, ctx: &ExecContext, dest: &mut ErasedRawStridedUninitMut<'_>, operand: &ErasedRawStridedPtr<'_>, scatter_indices: &ErasedRawStridedPtr<'_>, updates: &ErasedRawStridedPtr<'_>, ) -> Result<()>
On success, the copy phase initializes every reachable destination slot before the read-modify-write phase. Unreachable holes are neither read nor initialized. Validation errors before the copy leave the destination untouched; an error or panic after the copy may leave a mixture of old and new reachable values, all initialized and safely droppable.
Trait Implementations§
Source§impl Clone for ErasedScatterPlan
impl Clone for ErasedScatterPlan
Source§fn clone(&self) -> ErasedScatterPlan
fn clone(&self) -> ErasedScatterPlan
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 ErasedScatterPlan
impl RefUnwindSafe for ErasedScatterPlan
impl Send for ErasedScatterPlan
impl Sync for ErasedScatterPlan
impl Unpin for ErasedScatterPlan
impl UnsafeUnpin for ErasedScatterPlan
impl UnwindSafe for ErasedScatterPlan
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