cornell-zhang / heterocl

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

[API] Fix Wrong Index Calculation in API reuse_at #156

Closed seanlatias closed 4 years ago

seanlatias commented 4 years ago

This solves part of the problem in #155. Several tests are added to check the correctness under arbitrary shapes.

The issue comes from the wrong index flattening given a tuple of indices and the shape. It turns out to be just a single line fix.