Open hecmay opened 4 years ago
Another issue when applying reuse_at
to HeteroCL module. the issue was caused by the index recovery function in the IR pass function. The index recovery function works fine in common cases.
for (c, 0, 10)
for (rdx, 0, 3)
reducer += b[c*3 + rdx] // recovered index : b[c, rdx]
However, it failed to recover the accurate index with an addition if-then-else statement:
for (c, 0, 10)
for (rdx, 0, 3)
if (rdx < 2)
reducer += b[c*3 + rdx + 1] // recovered index failure
I added a quick fix in the generate_reuse_buffer
IR pass to update the range of iteration variable. The index can be recovered correctly and reuse can be inserted as expected.
Please check #156
Thanks! I will merge it. By the way I cannot merge form v0.3 branch. There is SegFault when importing hlib
from v0.3.
Here I want to reuse on one input in two different dimensions:
The result does not match with the ground truth when
reuse_at
schedule is applied. The IR is as followed:I am also wondering if it is possible to modify the
reuse_at
primitive and make it work on HeteroCL module. Generating reuse buffer along with.to()
takes a lot of efforts (I need to figure out which dimension to exploit reusability, and also to do a lot of repeat work asreuse_at
), and I am afraid that it cannot be done very soon. Reusing thereuse_at
primitive and making it compatible with HeteroCL might be a better idea.