cornell-zhang / hcl-dialect

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

TypeError: unsupported operand type(s) for &: #172

Closed jcasas00 closed 1 year ago

jcasas00 commented 1 year ago

def thistest_int_loadop(): hcl.init() def kernel(): v = hcl.scalar(-1, "v", hcl.UInt(128)) m = hcl.scalar(0xff, "v", hcl.UInt(8)) v.v = (0xffff) & m.v # r = hcl.compute((4,), lambda i: 0, dtype=hcl.UInt(32)) return r s = hcl.create_schedule([], kernel) print(hcl.lower(s)) hcl_res = hcl.asarray(np.zeros((4,), dtype=np.uint32), dtype=hcl.UInt(32)) f = hcl.build(s) f(hcl_res)

generates: TypeError: unsupported operand type(s) for &: 'int' and 'LoadOp'

zzzDavid commented 1 year ago

This issue is caused by missing right-hand side binary operations