tensor_line_size_perpendicular

Function tensor_line_size_perpendicular 

Source
pub fn tensor_line_size_perpendicular(
    supported_line_sizes: impl Iterator<Item = u8>,
    shape: &[usize],
    strides: &[usize],
    axis: usize,
) -> u8
Expand description

Find the maximum line size usable for perpendicular vectorization along the given axis from the supported line sizes or return 1 if vectorization is impossible.

This function is designed to never return a line size above 1 by error, but doesn’t guarantee to always return the actual maximum possible line size. That is, it may be overly strict.

Currently, this checks that the stride of the axis is divisible by a candidate line size and that the product of all shapes of axes with smaller strides is equal to the stride of the axis. The second condition ensure that elements within the stride are contiguous.