Skip to main content

fma_acc

Function fma_acc 

Source
pub fn fma_acc<D, A, B, OpA, OpB>(
    dest: &mut StridedViewMut<'_, D>,
    a: &StridedView<'_, A, OpA>,
    b: &StridedView<'_, B, OpB>,
    exec: Exec<'_>,
) -> Result<()>
where A: Copy + Mul<B, Output = D> + Send + Sync, B: Copy + Send + Sync, D: Copy + Add<D, Output = D> + Send + Sync, OpA: ElementOp<A>, OpB: ElementOp<B>,
Expand description

Accumulating fused multiply-add: dest[i] += OpA::apply(a[i]) * OpB::apply(b[i]).

Operands may have different element types. Element operations are applied lazily.

ยงErrors

Returns StridedError::RankMismatch or StridedError::ShapeMismatch when dest and an operand 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.