Skip to main content

broadcast_mul_into_uninit

Function broadcast_mul_into_uninit 

Source
pub fn broadcast_mul_into_uninit<D: Copy + MaybeSendSync + 'static, A: Copy + Mul<B, Output = D> + MaybeSendSync + 'static, B: Copy + MaybeSendSync + 'static, OpA: ElementOp<A>, OpB: ElementOp<B>>(
    dest: &mut StridedViewMut<'_, MaybeUninit<D>>,
    a: &StridedView<'_, A, OpA>,
    a_axes: &[usize],
    b: &StridedView<'_, B, OpB>,
    b_axes: &[usize],
) -> Result<()>
Expand description

Broadcast and multiply into a fully overwritten uninitialized output.

Axis mappings, shapes, destination injectivity, and reachable-byte overlap are validated before the first write. Safe Rust borrows already prevent input/output aliasing; the explicit overlap check preserves the contract for views produced through unsafe constructors.

Ok(()) means every logical destination element is initialized. An error occurs before writes. A panic during replay may leave a partially initialized destination, which remains safe to drop as MaybeUninit<D>.

ยงErrors

Returns a typed rank, axis, or shape error for an invalid broadcast mapping, StridedError::NonInjectiveOutputLayout for an overlapping output layout, StridedError::OverlappingInputOutput for aliased storage, or StridedError::OffsetOverflow when a reachable byte range is not representable.