loopy icon indicating copy to clipboard operation
loopy copied to clipboard

Type inference: callables may not get type-specialized

Open inducer opened this issue 3 years ago • 0 comments

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

inducer avatar Mar 06 '22 19:03 inducer