Traceback (most recent call last):
File "popcount.py", line 25, in <module>
f = hcl.build(s)
File "/home/chz/heterocl/python/heterocl/api.py", line 318, in build
return _build(schedule.sch, new_inputs, target=target, name=name, stmt=stmt)
File "/home/chz/heterocl/python/heterocl/tvm/build_module.py", line 840, in build
mhost = codegen.build_module(fhost, str(target_host))
File "/home/chz/heterocl/python/heterocl/tvm/codegen.py", line 20, in build_module
return _Build(lowered_func, target)
File "/home/chz/heterocl/python/heterocl/tvm/_ffi/function.py", line 280, in my_api_func
return flocal(*args)
File "/home/chz/heterocl/python/heterocl/tvm/_ffi/_ctypes/function.py", line 183, in __call__
ctypes.byref(ret_val), ctypes.byref(ret_tcode)))
File "/home/chz/heterocl/python/heterocl/tvm/_ffi/base.py", line 66, in check_call
raise TVMError(py_str(_LIB.TVMGetLastError()))
heterocl.tvm._ffi.base.TVMError: [19:06:13] src/codegen/llvm/codegen_llvm.cc:748: unknown intrinsic reinterpret
This bug is quite strange since it only happens for specific inputs. I write some test cases to demonstrate the behavior.
A = hcl.placeholder((3,), dtype=hcl.UInt(2), name="A")
for op1 in ["|","&"]:
for op2 in ["|","&"]:
for val1 in [1,2]:
for val2 in [1,2]:
test_case = "A[i] {} {} {} {}".format(op1,val1,op2,val2)
try:
def kernel(A):
return hcl.compute((3,), lambda i: eval(test_case), dtype=hcl.UInt(2))
s = hcl.create_schedule([A], kernel)
f = hcl.build(s)
print("{} passed".format(test_case))
except:
print("{} failed".format(test_case))
The following code that performs bitwise AND sequentially causes an "unknown intrinsic reinterpret" error.
The full traceback is reported below.
This bug is quite strange since it only happens for specific inputs. I write some test cases to demonstrate the behavior.
Only 3 of them failed the tests.