pub struct RunSumPlan { /* private fields */ }Expand description
dest[r, ..] (=|+=) Σ_{j in ptr[r]..ptr[r+1]} src[perm[j], ..].
Compiled once for a source layout, a destination layout and a
RunIndex’s row count; replayed with execute_into
or execute_acc.
Implementations§
Source§impl RunSumPlan
impl RunSumPlan
Sourcepub fn compile(
src_dims: &[usize],
src_strides: &[isize],
dest_dims: &[usize],
dest_strides: &[isize],
runs: &RunIndex,
) -> Result<Self>
pub fn compile( src_dims: &[usize], src_strides: &[isize], dest_dims: &[usize], dest_strides: &[isize], runs: &RunIndex, ) -> Result<Self>
Compile a replay for one source layout, one destination layout and the run count the index describes.
The layout facts a plan can prove without the buffers are proved here;
buffer bounds, alignment and the absence of dest/src overlap are the
caller’s RawStridedRef / RawStridedMut obligations. Allocates the
fused payload traversal; never called from the execute path.
§Errors
Returns StridedError::StrideLengthMismatch when a stride list does not
match its dimension list, StridedError::RankMismatch when the ranks
differ or there is no row axis, StridedError::ShapeMismatch when the
trailing extents differ or the row counts disagree with runs,
StridedError::OffsetOverflow when an element count does not fit
usize, and StridedError::NonInjectiveOutputLayout when the
destination layout cannot be proven injective.
Sourcepub fn execute_into<T>(
&self,
dest: &mut RawStridedMut<'_, T>,
src: &RawStridedRef<'_, T>,
runs: &RunIndex,
exec: Exec<'_>,
) -> Result<()>
pub fn execute_into<T>( &self, dest: &mut RawStridedMut<'_, T>, src: &RawStridedRef<'_, T>, runs: &RunIndex, exec: Exec<'_>, ) -> Result<()>
Execute the overwriting form: dest[r, ..] = Σ over the run, zeros for a
run with no rows. Never reads the previous destination value.
§Errors
Returns StridedError::PlanLayoutMismatch when a view does not carry
its compiled extents and strides, and StridedError::ShapeMismatch
when runs describes a different row or run count than compile was
given.
Sourcepub fn execute_acc<T>(
&self,
dest: &mut RawStridedMut<'_, T>,
src: &RawStridedRef<'_, T>,
runs: &RunIndex,
exec: Exec<'_>,
) -> Result<()>
pub fn execute_acc<T>( &self, dest: &mut RawStridedMut<'_, T>, src: &RawStridedRef<'_, T>, runs: &RunIndex, exec: Exec<'_>, ) -> Result<()>
Execute the accumulating form: dest[r, ..] += Σ over the run, nothing
for a run with no rows.
§Errors
As execute_into.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for RunSumPlan
impl RefUnwindSafe for RunSumPlan
impl Send for RunSumPlan
impl Sync for RunSumPlan
impl Unpin for RunSumPlan
impl UnsafeUnpin for RunSumPlan
impl UnwindSafe for RunSumPlan
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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more