How can I take a three-dimensional numpy.ndarray and bind it to a
texture<float,3>?
My thought was to do the following (given a 3D ndarray data and a
texture reference texref):
descr = cuda.ArrayDescriptor3D()
h, w, d = data.shape
descr.height = h
descr.width = w
descr.depth = d
descr.format = cuda.array_format.FLOAT
descr.num_channels = 1
ary = cuda.Array(descr)
copy = cuda.Memcpy3D()
copy.set_src_host(data)
copy.set_dst_array(ary)
copy.width_in_bytes = copy.src_pitch = copy.dst_pitch = data.strides[0]
copy.height = copy.src_height = h
copy.depth = d
copy()
texref.set_array(ary)
but this results in:
Traceback (most recent call last):
File "tex3d_test.py", line 42, in <module>
copy()
pycuda._driver.LaunchError: cuMemcpy3D failed: launch failed
terminate called after throwing an instance of 'cuda::error'
what(): cuModuleUnload failed: launch failed
Aborted
Thanks,
Dan Lepage
_______________________________________________
PyCuda mailing list
[email protected]
http://tiker.net/mailman/listinfo/pycuda_tiker.net