Vasco <[email protected]> writes:

> Hi,
> I want to copy the contents of a float to the imaginary part of a 
> complex on the gpu. Something like:
>
> a = gpuarray.zeros(1,dtype=float)
> c = gpuarray.zeros(1,dtype=complex)
> c.gpudata.imag = float.gpudata

This would be a non-contiguous copy. (I.e. it would assign every second
float.) CUDA's built-in copies can't do that. The easiest way is to
use an elementwise kernel, from which you can use your set_real and
set_imag functions.

HTH,
Andreas

_______________________________________________
PyCUDA mailing list
[email protected]
http://lists.tiker.net/listinfo/pycuda

Reply via email to