Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inlining generates an unknown _lpy_arg #728

Closed
isuruf opened this issue Jan 11, 2023 · 2 comments · Fixed by #733
Closed

Inlining generates an unknown _lpy_arg #728

isuruf opened this issue Jan 11, 2023 · 2 comments · Fixed by #733

Comments

@isuruf
Copy link
Collaborator

isuruf commented Jan 11, 2023

import loopy as lp
import numpy as np
child_knl = lp.make_function(
        [],
        """
        g[0] = 2*e[0] + 3*f[0]
        g[1] = 2*e[1] + 3*f[1]
        """, name="linear_combo")
parent_knl = lp.make_kernel(
        ["{[j]:0<=j<n}", "{[i]:0<=i<n}"],
        """
        [i]: z[i, j] = linear_combo([i]: x[i, j], [i]: y[i,j])
        """,
        kernel_data=[
            lp.GlobalArg(
                name="x, y, z",
                dtype=np.float64,
                shape=("n", "n")),
            ...],
        assumptions="n>=1",
        )
knl = lp.merge([parent_knl, child_knl])
knl = lp.inline_callable_kernel(knl, "linear_combo")
print(lp.generate_code_v2(knl).device_code())

Above program fails with TypeInferenceFailure: name not known in type inference: _lpy_arg

@isuruf
Copy link
Collaborator Author

isuruf commented Jan 11, 2023

cc @kaushikcfd

@inducer
Copy link
Owner

inducer commented Jan 12, 2023

#648 is possibly related.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants