Hi, I’m looking to swap the real and imaginary arrays of a cufftComplex type inside a kernel, however, the code yields the following compile errors wherever I try to use the cufftComplex arrays:
no operator "[]" matches these operands
operand types are: cufftComplex [ int ]
My code:
global void
kernel( cufftComplex* d_signal, cufftComplex* dout )
{
const int idx = blockIdx.x * blockDim.x + threadIdx.x;
Thank you for the help, mfatica, that fixed the compile errors inside the kernel, however the compiler now chokes on the call to the kernel itself:
: error: no suitable conversion function from
“cufftComplex” to “cufftComplex *” exists
Subtle C bug here. The * is not attached to the type, like most people expect. Instead, the * modifier is attached to the variable. You need to put a * on each variable for both to be recognized as pointers. (Not sure why this didn’t trigger a warning in your second cudaMalloc() call, but perhaps the void** casting confused the compiler.) Try this: