pub struct ErasedGatherPlan { /* private fields */ }Expand description
Dtype-erased gather wrapper.
This is the erased replay boundary for indexed reads. Value buffers use the
configured value dtype, while the index descriptor must use i32 or i64.
Implementations§
Source§impl ErasedGatherPlan
impl ErasedGatherPlan
Sourcepub fn compile(
dtype: KernelDType,
index_dtype: KernelDType,
operand_dims: &[usize],
operand_strides: &[isize],
index_dims: &[usize],
index_strides: &[isize],
dest_dims: &[usize],
dest_strides: &[isize],
spec: GatherSpec,
) -> Result<Self>
pub fn compile( dtype: KernelDType, index_dtype: KernelDType, operand_dims: &[usize], operand_strides: &[isize], index_dims: &[usize], index_strides: &[isize], dest_dims: &[usize], dest_strides: &[isize], spec: GatherSpec, ) -> Result<Self>
Validate and store a gather 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) -> &GatherPlan
Sourcepub fn execute(
&self,
ctx: &ExecContext,
dest: &mut ErasedRawStridedMut<'_>,
operand: &ErasedRawStridedRef<'_>,
start_indices: &ErasedRawStridedRef<'_>,
) -> Result<()>
pub fn execute( &self, ctx: &ExecContext, dest: &mut ErasedRawStridedMut<'_>, operand: &ErasedRawStridedRef<'_>, start_indices: &ErasedRawStridedRef<'_>, ) -> Result<()>
Execute an indexed read into an erased output descriptor.
Sourcepub fn execute_uninit(
&self,
ctx: &ExecContext,
dest: &mut ErasedRawStridedUninitMut<'_>,
operand: &ErasedRawStridedPtr<'_>,
start_indices: &ErasedRawStridedPtr<'_>,
) -> Result<()>
pub fn execute_uninit( &self, ctx: &ExecContext, dest: &mut ErasedRawStridedUninitMut<'_>, operand: &ErasedRawStridedPtr<'_>, start_indices: &ErasedRawStridedPtr<'_>, ) -> Result<()>
Execute gather into a destination whose reachable slots may be
uninitialized. All validation precedes the first destination write.
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 ErasedGatherPlan
impl Clone for ErasedGatherPlan
Source§fn clone(&self) -> ErasedGatherPlan
fn clone(&self) -> ErasedGatherPlan
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more