ValueError: Direct host side access to device memory is detected in simple. Did you forget to bind?
I got an error when running this code
import tvm
import topi
import topi.nn
def generate_opencl():
a = tvm.placeholder((16, 3, 255, 255), name="image")
# b = topi.transpose(a)
b = tvm.placeholder((16, 3, 255, 255), name="bias")
c = a + b
s = tvm.create_schedule(c.op)
target = "opencl"
#target="llvm"
target_host = "llvm"
lib = tvm.build(s, [a, b, c], target, target_host, name='simple')
if target == "llvm":
print (lib.get_source())
else:
print (lib.imported_modules[0].get_source())
return
if __name__ == "__main__":
generate_opencl()
code version is 0c523787297039ce00b320c1d32e022e61e97ac2
I have enabled llvm and cuda in config.cmake, but I didn’t enable opencl runtime because some environment issue, does it matter?
If I set target to “cuda”, I got same error.
And I got same error with get_start.py if changing tgt to “opencl”