pub fn tensor_vector_size_perpendicular(
supported_vector_sizes: impl Iterator<Item = usize>,
shape: &[usize],
strides: &[usize],
axis: usize,
) -> usizeExpand description
Find the maximum vector size usable for perpendicular vectorization along the given axis from the supported vector sizes or return 1 if vectorization is impossible.
This function is designed to never return a vector size above 1 by error, but doesn’t guarantee to always return the actual maximum possible vector size. That is, it may be overly strict.
Currently, this checks that the stride of the axis is divisible by a candidate vector 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.