loopy
loopy copied to clipboard
Loopy's host-side shape inference cannot solve system of equations
knl = lp.make_kernel(
"{[i, j]: 0<=i<(2*n + 3*m + 2) and 0<=j<(6*n + 4*m + 3)}",
"""
out = sum([i, j], A[i, j])
""")
knl(cq, A=np.random.randn(20, 37))
fails with
File "<generated code>", line 52, in invoke_loopy_kernel_loopy_kernel
TypeError: value argument 'm' was not given and could not be automatically determined
Loopy couldn't infer that n=3, m=4 corresponds from A's shape.
As far as I remember, Loopy's system solving does not attempt divisions, so I'm not surprised this doesn't work. That functionality should really just use isl.