inducer / inducer/pytato

[loopy-codegen, bug] Code generation for tagged `NamedArray`s is buggy

Open
#195 6 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
15
Forks
16
Avg merge
17m
Merged PRs (30d)
1

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 https://github.com/inducer/pytato/blob/1c9ee78b08df2375a4a27371f9f09138cec25081/pytato/array.py#L718-L722

---

Loopy codegen is broken for tagged instances of `NamedArray` for the same reason. Here's an MWE:
```python
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
```

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.