Hi, I want to compute the FFT of a vector. Here there is a part of code:
#include <stdio.h>
#include <stdlib.h>
#include <cuda_runtime.h>
#include <cutil.h>
#include <cuda.h>
#include <cufft.h>
#define NX 256;
#define BATCH 1
int main(){
const int N=20;
float* h_a;
float* h_t;
float* d_a;
//Allocation on host
h_a=new float[N];
h_t=new float[2*N];
//Data input
for (int i=0;i<N;i++){
h_a[i]=1;
}
size_t size=N*sizeof(float);
//Allocation on device
cudaMalloc((void**)& d_a, size);
cudaMemcpy(d_a, h_a, size, cudaMemcpyHostToDevice);
cufftHandle plan;
cufftComplex *data;
cudaMalloc((void**)&data, sizeof(cufftComplex)*(NX/2+1)*BATCH);
The compiler gives me this error on the last line:
1>sample.cu(37): error: expected a “)”
What’ s the mistake?