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.

First I try:
<code>
import pycuda.driver as cuda
#... import other things
row = numpy.random.randn(1,5).astype(numpy.complex64)
cuda.matrix_to_texref(row, texref, order="F")
</code>
which fails with: TypeError: cannot convert dtype 'complex64' to array format

I encounter the same error when attempting to use:
<code>
texref.set_array(cuda.matrix_to_array(row,"F"))
</code>
presumably for the same reason.

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
FLOAT. Specifically,
<code>
h, w = row.shape
descr = cuda.ArrayDescriptor()
descr.w = w
descr.h =h
descr.format = cuda.array_format.FLOAT
descr.num_channels = 2
descr.flags = 0

ary = cuda.Array(descr)
</code>
and this last line gives me the cryptic error:
"pycuda._driver.LogicError: cuArrayCreate failed: invalid value."

Any advice on setting up complex-valued textures using CUDA float2s
and numpy arrays would be most appreciated. Thanks,

Ahmed

_______________________________________________
PyCuda mailing list
[email protected]
http://tiker.net/mailman/listinfo/pycuda_tiker.net

Reply via email to