How to parallelize FFT computation in MKL?

How to parallelize FFT computation in MKL?

I try to parallelize the fft computation in each row of the matrix fu(m,2), but the result is not correct. The following is my code:

type(DFTI_DESCRIPTOR), SAVE,POINTER :: My_FFT_Handle

nthreads=omp_get_max_threads ();

Status = DftiCreateDescriptor(My_FFT_Handle, DFTI_DOUBLE, DFTI_REAL, 1, m)

Status = DftiSetValue (My_FFT_Handle, DFTI_NUMBER_OF_USER_THREADS, nThreads);

Status = DftiCommitDescriptor(My_FFT_Handle)

!$OMP PARALLEL DO

do ic=1,2

Status = DftiComputeForward(My_FFT_Handle,fu(:,ic))

end do

!$OMP END PARALLEL DO
stop

The results of fu(:,2) is sometimes not correct. Whats wrong in the code?

Thank you.

1 post / 0 new
For more complete information about compiler optimizations, see our Optimization Notice.