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] Minor Bug Fixes #285

Closed seanlatias closed 4 years ago

seanlatias commented 4 years ago

In this PR, the following bugs are fixed. More minor fixes will be added to this PR.

  1. Nested hcl.compute with hcl.return_ generated weird error. Root cause: Incorrect implementation of the mutator that removes redundant casting Test case: test_compute_basic.py/test_fcompute_nested and test_compute_basic.py/test_fcompute_nested_imperative

  2. Sefgault when subtracting an Int with UInt. Root cause: Incorrect simplification logic with subtraction, which causes infinite execution. Test case: test_dtype.py/test_dtype_cast In this test, we test through all possible permutations of different data types, including int, uint, fixed, ufixed, and float.

  3. Cannot access the data type of an input tensor during packing Root cause: The data type is a string, which should be a HeteroCL data type instead Test case: test_compute_pack_unpack.py/test_pack_dtype_str