Closed jcasas00 closed 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'
This issue is caused by missing right-hand side binary operations
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'