cornell-zhang/hcl-dialect

hcl.print failure if the argument is a tuple with an int/float value.

jcasas00 opened this issue · 3 comments

    def kernel():
        a = hcl.scalar(0, "a", 'int32')
        b = 1
        hcl.print((a.v,b), "FOO %d %d\n")

Generates the following error:

  File "/home/jcasas/dprive/heterocl_mlir/hcl-dialect-prototype/build/tools/hcl/python_packages/hcl_core/hcl_mlir/build_ir.py", line 1511, in <listcomp>
    self.operands = [v.result for v in val]
AttributeError: 'int' object has no attribute 'result'

Looks like if the args parameter to print is a tuple, hcl currently assumes all entries are hcl expressions.

Thanks. Works now.

Closing the thread as the issue was fixed