Function reduce_slice_shared

Source
pub fn reduce_slice_shared<P: ReducePrecision, I: List<Line<P::EI>>, R: ReduceInstruction<P>>(
    items: &I,
    inst: &R,
    range: ReduceRange,
    accumulator_size: u32,
    line_size: u32,
    line_mode: LineMode,
    use_planes: bool,
    bound_checks: BoundChecksInner,
) -> R::SharedAccumulator
Expand description

Use an individual cube to reduce the items with the specified range. That is, this will reduces items[range.start], items[range.start + range.step] until items[range.end] (exclusive). Inside a cube, the reduction will use plane operations if use_planes is set to true.

This reduces using the given line_mode but doesn’t reduce the accumulator itself.

When use_planes is true, this assumes that UNIT_POS_Y provides the relative position of a plane within its cube.

Since each individual cube performs a reduction, this function is meant to be called with either a different items for each cube, a different range or both based on CUBE_POS.