cornell-zhang / hcl-dialect

HeteroCL-MLIR dialect for accelerator design
https://cornell-zhang.github.io/heterocl/index.html
Other
40 stars 17 forks source link

hcl.asarray doesn't support string dtype #142

Closed jcasas00 closed 2 years ago

jcasas00 commented 2 years ago

hcl_res = hcl.asarray(np.zeros((2,), dtype=np.uint32), dtype='uint32')

generates the following error:

hcl_res = hcl.asarray(np.zeros((2,), dtype=np.uint32), dtype='uint32') File "python/heterocl/operation.py", line 45, in asarray raise RuntimeError("Should provide hcl.Type. Got string") RuntimeError: Should provide hcl.Type. Got string

This works on the main branch.

zzzDavid commented 2 years ago

Fixed by cornell-zhang/heterocl@776e89090d213d989b5362fc0c4261d09382597f. Test cases to be added.

zzzDavid commented 2 years ago

Test case is added at mlir/test_api.py::test_str_fmt_asarray with this commit: cornell-zhang/heterocl@9dd69947c615121a0887617ab9e26ae96de66f45