On Montag 19 April 2010, Ian Ozsvald wrote:
> I find myself out of my depth again. I'm playing with complex numbers
> using 0.94rc (on Windows XP with CUDA 2.3). I've successfully used
> simple operations (addition, multiplication) on complex numbers, that
> resulted in the Mandelbrot example in the wiki.
> 
> Now I'm trying sin and log and I'm getting errors and one positive
> result (see the end). I'm not sure if these functions are supported
> yet? If anyone can point me in the right direction (and perhaps
> suggest what needs implementing) then I'll have a go at fixing the
> problem.
> 
> For reference, you can do the following using numpy on the CPU for
> verification: In [117]: numpy.sin(numpy.array(numpy.complex64(1-1j)))
> Out[117]: (1.2984576-0.63496387j)
> 
> Here are two pieces of test code. At first I used multiplication
> (rather than sin()) to confirm that the code ran as expected.
> 
> Next I tried creating a simple complex64 array, passing it to the GPU
> and then asking for pycuda.cumath.sin() - this results in "Error:
> External calls are not supported". Here's the code and error:

Fixed/added in git, both for cumath and elwise.

> I replaced:
> pycuda.cumath.sin(a_gpu) # should produce (1.29-0.63j)
> with:
> pycuda.cumath.log(a_gpu) # should produce (0.34-0.78j)
> and the code ran without an error...but produced the wrong result. It
> generates (1-1j) which looks like a no-op.

cumath ops aren't in-place--you need to print the returned value.

HTH,
Andreas

Attachment: signature.asc
Description: This is a digitally signed message part.

_______________________________________________
PyCUDA mailing list
PyCUDA@tiker.net
http://lists.tiker.net/listinfo/pycuda

Reply via email to