inducer / inducer/loopy

Type inference: callables may not get type-specialized

Open
#562 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
636
Forks
81
Avg merge
1d 19h
Merged PRs (30d)
7

Description

Consider the following kernel:
```py
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

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.