import numpy
import numpy as np
from numbapro import cuda
@cuda.autojit
def foo(aryA, aryB,out):
d_ary1 = cuda.to_device(aryA)
d_ary2 = cuda.to_device(aryB)
#dd = numpy.empty(10, dtype=np.int32)
d_ary1.copy_to_host(out)
griddim = 1, 2
blockdim = 3, 4
aryA = numpy.arange(10, dtype=np.int32)
aryB = numpy.arange(10, dtype=np.int32)
out = numpy.empty(10, dtype=np.int32)
foo[griddim, blockdim](aryA, aryB,out)
Exception: Caused by input line 11: can only get attribute from globals, complex numbers or arrays
I am new to numbapro, hints are needed!
The
@cuda.autotjit
marks and compilesfoo()
as a CUDA kernel. The memory transfer operations should be placed outside of the kernel. It should look like the following code:I recommend new NumbaPro users to look at the examples in https://github.com/ContinuumIO/numbapro-examples.