cuComplex just need some general advice

I’m looking for a bit of fairly general advice before I set to work on properly coding up my application. I currently have a working code in mathematica using their built in CUDA support so I have a version of all of my kernels but most other stuff is taken care of automatically like memory allocation and my FFT’s etc.

The bit I am unsure about before I start is what type I need to be using to store my data. Most of my data is 2D arrays of Complex numbers. Currently my kernels just use the float type and I access the real part using threadidx.x… and the Imaginary part with threadidx.x+1. I also do alot of Fourier transforms on the data and I think my data needs to be cuComplex for this? My question really is what I will need to change in my kernels so they accept arrays of cuComplex type instead of just floats. Or indeed if this is even the right thing to do.

Sorry if this makes no sense, I’m fairly new to this.

Since you are already doing complex arithmetic, switching to cuComplex should not be a problem. Take a look at cuComplex.h in cuda Toolkit installation directory. It has basic rountines that will help you move to cuComplex. Also, you might get some performance benefit if you didn’t have coalesced access in your current implementation as threads can read a 64-bit word( [real, complex] in a vector v2 read operation).