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

[Frontend] Automatic Type Casting for SelectOp #109

Closed zzzDavid closed 1 year ago

zzzDavid commented 2 years ago

This thread is for automatic type casting for hcl.select API. Related test: mlir/test_codegen_vhls.py::test_select_type_cast Error message:

RuntimeError: SelectOp should have two same type of inputs.
zzzDavid commented 1 year ago

Closing this thread as we have a type inference engine with extensible typing rules in the frontend. We have added selectOp rules to make sure true and false values are of the same type: https://github.com/cornell-zhang/heterocl/blob/1033b8368670a1e57e8537946e87c4ce795721a2/python/heterocl/type_rules.py#L444-L507