loopy
loopy copied to clipboard
Type inference: callables may not get type-specialized
Consider the following kernel:
knl = lp.make_kernel(
["{[i]: 0<=i<10}"],
"""
a[i] = a[abs(5-i)]
""",
[
lp.GlobalArg("a", np.int32, shape=(10,), is_input=False),
...
])
Our type inference is currently driven by unknown types in variables. But we also need to ensure callables are type-specialized, and we can't rely on variable-driven inference alone to do this. The above kernel is an example where the type of a is known, and therefore abs as callable never gets type-specialized.
cc @kaushikcfd @isuruf