Skip to main content

axpy_acc

Function axpy_acc 

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

Accumulating AXPY: dest[i] = alpha * src[i] + dest[i].

Alpha, source, and destination may have different element types.

ยง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.