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.
§Destination contract
StridedError::NonInjectiveOutputLayout when two logical indices of
dest name the same element (for example a stride-0 broadcast axis of
extent above one): the update reads and writes dest, so an aliased
destination would be order-dependent, and a race under a threaded exec.