On Sonntag 08 März 2009, Ahmed Fasih wrote:
Hi, I'm having *no* trouble copying numpy matrices
of type complex64
to the GPU global memory and working on them as float2's, but when
attempting to use such numpy matrices to initialize *textures*, I seem
to be running into some problems.
I'd be happy to take a patch that lets matrix_to_array accept complex32
matrices and convert them to float2 textures.
I then attempted to recreate the functionality in
cuda.matrix_to_array() by building an ArrayDescriptor and using
Memcpy2D, but making use of the ArrayDescriptor.num_channels field,
which I believe allows the creation of float2's when its format is
h, w = row.shape
descr = cuda.ArrayDescriptor()
descr.w = w
descr.format = cuda.array_format.FLOAT
descr.num_channels = 2
descr.flags = 0
ary = cuda.Array(descr)
and this last line gives me the cryptic error:
"pycuda._driver.LogicError: cuArrayCreate failed: invalid value."
Can you post the values of w and h? Also, descr doesn't have a 'flags'
attribute. Or, feel free to post a reduced test case--this should definitely