I'm copying via pycuda some arrays on the GPU and then store the pointers to these arrays. How do I recuperate the data back?
dist = np.zeros(numPoints).astype(np.float32)
distAddress = [gpuarray.to_gpu(dist).ptr for i in range(100)]
If I call the memcpy_dtoh function:
buf = np.zeros(400).astype(np.float32)
cuda.memcpy_dtoh(buf,distAddress[0])
, (where type(distAddress[0])
is long
) I get the following error:
cuda.memcpy_dtoh(buf, distAddress[0])
LogicError: cuMemcpyDtoH failed: invalid argument
What am I doing wrong?
Thanks!