-
Notifications
You must be signed in to change notification settings - Fork 16
[loopy-codegen, bug] Code generation for tagged NamedArrays is buggy #195
Copy link
Copy link
Open
Description
Tagging a named array and then accessing other results of the container loses the tag information as it might freshly create a "dirty" no-tagged variant, see
Lines 718 to 722 in 1c9ee78
| @memoize_method | |
| def __getitem__(self, name: str) -> NamedArray: | |
| if name not in self._data: | |
| raise KeyError(name) | |
| return NamedArray(self, name) |
Loopy codegen is broken for tagged instances of NamedArray for the same reason. Here's an MWE:
class FooTag(Tag):
pass
knl = lp.make_kernel(
"{[i]: 0<=i<10}",
"""
y[i] = i
""")
y = call_loopy(knl, bindings={})["y"]
y = y.tagged(FooTag())
pt.generate_loopy(2 * y)raises:
File "/home/kgk2/projects/ceesd/pytato/pytato/target/loopy/codegen.py", line 414, in map_named_array
assert expr in state.results
AssertionError
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels