- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I'm having trouble trying to get the FFT to work consistently. My code gives me the right results but crashes after a certain number of runs.
Dim st As ipp.IppStatus
Dim fftOrder = 10
Dim L As Integer = 2 ^ fftOrder
Dim sig1(L) As ipp.Ipp64fc
Dim pSig1 As IntPtr = GetPtr(sig1)
Dim sig2(L) As ipp.Ipp64fc
Dim pSig2 As IntPtr = GetPtr(sig2)
Dim phase() As Double = {0}
Dim pPhase As IntPtr = GetPtr(phase)
Dim FFTflag As Integer = ipp.IppsFFTFlags.IPP_FFT_DIV_FWD_BY_N
Dim pFFTspec(0) As IntPtr
Dim ppFFTSpec As IntPtr = GetPtr(pFFTspec)
Public Function GetPtr(ByRef Array As Array) As IntPtr
Return System.Runtime.InteropServices.Marshal.UnsafeAddrOfPinnedArrayElement(Array, 0)
End Function
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
st = ipp.sp.ippsFFTInitAlloc_C_64fc(ppFFTSpec, fftOrder, FFTflag, ipp.IppHintAlgorithm.ippAlgHintFast) 'Initilise FFT
st = ipp.sp.ippsTone_Direct_64fc(pSig1, L, 1, 999 / L, pPhase, ipp.IppHintAlgorithm.ippAlgHintFast) 'Make a tone
st = ipp.sp.ippsWinBlackman_64fc_I(pSig1, L, CDbl(0.3)) 'Apply Window
st = ipp.sp.ippsFFTFwd_CToC_64fc(pSig1, pSig2, pFFTspec(0), Nothing) 'Do the FFT
'This runs many times succesfully then genarates the following error
' FatalExecutionEngineError was detected
' Message: The runtime has encountered a fatal error. The address of the error was at 0x79e73c0b, on thread 0x15b0. The error code is 0xc0000005. This error may be a bug in the CLR or in the unsafe or non-verifiable portions of user code. Common sources of this bug include user marshaling errors for COM-interop or PInvoke, which may corrupt the stack.
st = ipp.sp.ippsFFTFree_C_64fc(pFFTspec(0)) 'FREE FFT MEMORY
End Sub
' Im using the following version of IPP
Package ID: w_ipp_ia32_p_5.3.1.064
Package Contents: Intel IPP 5.3 Update 1 for Windows* on IA-32 Intel Architecture
Thanks in Advance
Iain
Dim st As ipp.IppStatus
Dim fftOrder = 10
Dim L As Integer = 2 ^ fftOrder
Dim sig1(L) As ipp.Ipp64fc
Dim pSig1 As IntPtr = GetPtr(sig1)
Dim sig2(L) As ipp.Ipp64fc
Dim pSig2 As IntPtr = GetPtr(sig2)
Dim phase() As Double = {0}
Dim pPhase As IntPtr = GetPtr(phase)
Dim FFTflag As Integer = ipp.IppsFFTFlags.IPP_FFT_DIV_FWD_BY_N
Dim pFFTspec(0) As IntPtr
Dim ppFFTSpec As IntPtr = GetPtr(pFFTspec)
Public Function GetPtr(ByRef Array As Array) As IntPtr
Return System.Runtime.InteropServices.Marshal.UnsafeAddrOfPinnedArrayElement(Array, 0)
End Function
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
st = ipp.sp.ippsFFTInitAlloc_C_64fc(ppFFTSpec, fftOrder, FFTflag, ipp.IppHintAlgorithm.ippAlgHintFast) 'Initilise FFT
st = ipp.sp.ippsTone_Direct_64fc(pSig1, L, 1, 999 / L, pPhase, ipp.IppHintAlgorithm.ippAlgHintFast) 'Make a tone
st = ipp.sp.ippsWinBlackman_64fc_I(pSig1, L, CDbl(0.3)) 'Apply Window
st = ipp.sp.ippsFFTFwd_CToC_64fc(pSig1, pSig2, pFFTspec(0), Nothing) 'Do the FFT
'This runs many times succesfully then genarates the following error
' FatalExecutionEngineError was detected
' Message: The runtime has encountered a fatal error. The address of the error was at 0x79e73c0b, on thread 0x15b0. The error code is 0xc0000005. This error may be a bug in the CLR or in the unsafe or non-verifiable portions of user code. Common sources of this bug include user marshaling errors for COM-interop or PInvoke, which may corrupt the stack.
st = ipp.sp.ippsFFTFree_C_64fc(pFFTspec(0)) 'FREE FFT MEMORY
End Sub
' Im using the following version of IPP
Package ID: w_ipp_ia32_p_5.3.1.064
Package Contents: Intel IPP 5.3 Update 1 for Windows* on IA-32 Intel Architecture
Thanks in Advance
Iain
Link Copied
1 Reply
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
we were not able to reproduce that issue. Could you please provide a test case if you did not solve it yet?
Regards,
Vladimir

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page