Hello

I’m trying to implement a 1D Complex to Complex Transform, using the example of the CUFFT documentation. When i run my programm i just get the error Segmentation fault.

Here is my source code:

[b] int N = pow(2.0,i);

cufftHandle p;

cufftComplex *in, *out;
float* MWs;

MWs = new float [N];

Messwerte(N, 0, 1, MWs);

```
complex<float>* Trafo;
Trafo = new complex<float> [N];
cudaMalloc((void**)&in, sizeof(cufftComplex)*N);
cudaMalloc((void**)&out, sizeof(cufftComplex)*N);
cufftPlan1d(&p, N, CUFFT_C2C, 1);
for (int i = 0; i < N ; i++)
{
in[i].x = MWs[i];
in[i].y = 0.0;
}
cufftExecC2C(p, in, out, 1);
for (int i = 0; i < N; i++)
{
Trafo[i].real() = out[i].x;
Trafo[i].imag() = out[i].y;
}
Vektorausgabe(Trafo,N);
delete[] Trafo; cufftDestroy(p); cudaFree(in); cudaFree(out); delete[] MWs;[/b]
```

The Array MWs cotains the Data which i want to transform. The Error happens when i try to use the in and out arrays. Can anybody tell me, how to write data to the in array and read data from the out array?

Thanks alot