Skip to content

Defer array shape guessing until needed

Array shapes, if not given, are guessed during make_kernel. This means, e.g., fusing kernels whose shared arguments would individually result in different guessed shapes would fail (and would perhaps also cause issues where isl would benefit from having parameters fixed).

As a first test, the changes here allow for successful add_prefetch for a kernel fused from two kernels computing stencils in different axes. This works by removing guess_arg_shape_if_requested from make_kernel and adding it to add_prefetch as needed. (I can provide example code if needed.)

Most/all of the CI test errors (TypeError: 'type' object is not iterable) are from various map_subscript calls, get_iname_strides, and num_user_axes.

I'd be happy to attempt to implement a generic fix if a simple solution is apparent.

Edited by Zach Weiner