I am trying to use the Math Kernel Library to develop a Fourier analysis from a bigger program but I need to do it as a .DLL file. The problem is that I have been facing problem when I change the vector length to from 128 to the next power of 2, or 256, or higher. It happens everytime when the DFTICommitDescriptor is called. The message is:
"Unhandled exception at 0x00000000 in Console1.exe: 0xC0000005: Access violation."
This problem doesn't show when the input size vector is smaller and when my functions are called together with my MAIN.f90 as an auxiliary functions as .f90 files.
Here is the following implemented FFT code for the .DLL :
USE MKL95_PRECISION, ONLY: WP =>SP
integer, intent(in) :: dim
complex, dimension(dim), intent(in) :: x
complex, dimension(dim), intent(inout) :: y
complex(8), dimension(dim) :: y_aux
type(DFTI_DESCRIPTOR), POINTER :: My_Desc_Handle
Integer :: Status
Status = -1
y_aux = DBLE(x)
Status = DftiCreateDescriptor(My_Desc_Handle, DFTI_DOUBLE, DFTI_COMPLEX,1,dim)
Status = DftiCommitDescriptor(My_Desc_Handle)Status = DftiComputeForward(My_Desc_Handle, y_aux)
y = y_aux
Status = DftiFreeDescriptor(My_Desc_Handle)
end subroutine AnaVib_FFT
end module AnaVib_FFT_module
Thanks in advance.