Skip to main content

add_acc

Function add_acc 

Source
pub fn add_acc<D: Copy + Add<S, Output = D> + Send + Sync, S: Copy + Send + Sync, Op: ElementOp<S>>(
    dest: &mut StridedViewMut<'_, D>,
    src: &StridedView<'_, S, Op>,
    exec: Exec<'_>,
) -> Result<()>
Expand description

Accumulating element-wise addition: dest[i] += src[i].

Source may have a different element type from destination.

ยงErrors

Returns StridedError::RankMismatch or StridedError::ShapeMismatch when the views describe different extents, and StridedError::OffsetOverflow when the element count of the shape does not fit in usize. Every check runs before the first write, so a rejected call leaves dest untouched.