Hi Andreas,
Using pycuda-complex doesn't have this issue. Therefore, I think it is not safe to use cuComplex types in passing scalar variables to the kernel, for now. I'm not sure how exactly python or the wrapper handles complex numbers internally, but cuComplex is basically a float2/double2 struct, might be different thus cause the problem.
Yiyin

On 9/21/2010 11:10 PM, Andreas Kloeckner wrote:
Hi Yiyin,

On Tue, 21 Sep 2010 15:53:50 -0400, Yiyin Zhou<heeroz...@gmail.com>  wrote:
Thanks. Actually I thought this problem is somehow related to the
problem I have, so I listed that simple demo.

The actual problem I have is to pass a complex scalar to a kernel,
type is defined by cuComplex.h, it sometimes gave me an incorrect
result (I guess the input argument struct is misaligned). I have
attached a script to reproduce this error.
Hmm--I can't really say much about cuComplex. PyCUDA's complex stuff is
from

#include<pycuda-complex.hpp>

and the type is

pycuda::complex<float>

But you are right--this does look like an alignment issue. Please speak
up if you can also reproduce this with the PyCUDA types.

Andreas


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

Reply via email to