cornell-zhang / heterocl

HeteroCL: A Multi-Paradigm Programming Infrastructure for Software-Defined Heterogeneous Computing
https://cornell-zhang.github.io/heterocl/
Apache License 2.0
326 stars 92 forks source link

reuse_at does not work for tensors not from placeholders #254

Closed seanlatias closed 4 years ago

seanlatias commented 4 years ago

The following code doesn't work, which generates a ValueError stating that member tensor cannot be found.

A = hcl.placeholder((10,10))

def foo(A):
    B = hcl.compute(A.shape, lambda y, x: A[y, x], "B")
    return hcl.compute((10, 8), lambda y, x: B[y, x] + B[y, x+1] + B[y, x+2], "C")

s = hcl.create_schedule([A], foo)
s.reuse_at(foo.B, s[foo.C], foo.C.axis[1])
seanlatias commented 4 years ago

Solved by #255 and the test is here.

zhangzhiru commented 4 years ago

I suggest we briefly describe the problem and the solution for each bug fix