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

[API] Add new memory primitive: reshape #111

Closed seanlatias closed 5 years ago

seanlatias commented 5 years ago

In this PR, a new memory primitive is introduced. With this primitive, users can reshape a tensor during scheduling. This primitive can be useful in combination with other compute primitives such as splitting.

This PR also fixes the following problem:

  1. Incorrect index recovering for HLS code generation
  2. Incorrect index inference for reuse buffer

With this PR, now the reuse buffer feature is more robust. However, we still need to add more features in order to make it more useful. For instance, how should we handle the case when tiling and reuse buffer are combined. For now we can generate code with correct functional behavior; however, it does not have the ideal performance. This might also relate to other HLS codegen problem, where the parallelization cannot be handled ideally.