<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>sujet High CPU Load with IPP FFTs dans Intel® Integrated Performance Primitives</title>
    <link>https://community.intel.com/t5/Intel-Integrated-Performance/High-CPU-Load-with-IPP-FFTs/m-p/886234#M10844</link>
    <description>&lt;P&gt;I am having a problem when using IPP for performing FFTs. I have written a small test app that demonstrates the problem. Have a look at the following 3 varients of a function I have written:&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;1. Perform 50 * 32K FFTs in quick succession.&lt;/P&gt;
&lt;P&gt;double TForm1::FFT(Ipp64u* pTimes)&lt;BR /&gt;{&lt;BR /&gt; IppsFFTSpec_C_32f* pFFTSpec = 0;&lt;BR /&gt; int iBufferSize = 0;&lt;BR /&gt; float* pFloatPointers[20];&lt;BR /&gt; char* pExtraBuffer = 0;&lt;BR /&gt; int iFFTOrder = 15;&lt;BR /&gt; int iFFTSize = 32768;&lt;BR /&gt; Ipp64u start, end;&lt;BR /&gt;&lt;BR /&gt; int i = 0;&lt;BR /&gt; while(i &amp;lt; 20)&lt;BR /&gt; {&lt;BR /&gt; pFloatPointers&lt;I&gt; = (float*)ippMalloc(iFFTSize * sizeof(float));&lt;BR /&gt; ippsSet_32f(10.0, pFloatPointers[i++], iFFTSize);&lt;BR /&gt; }&lt;BR /&gt;&lt;BR /&gt; double t1 = Now();&lt;BR /&gt;&lt;BR /&gt; // Create the FFT Specification structure with the flags and hints we want&lt;BR /&gt; ippsFFTInitAlloc_C_32f(&amp;amp;pFFTSpec, iFFTOrder, IPP_FFT_NODIV_BY_ANY, ippAlgHintNone);&lt;BR /&gt;&lt;BR /&gt; // Now work out the size of external buffer we should allocate&lt;BR /&gt; // This buffer isn't necessary but FFT calls are faster if it's calculated up front&lt;BR /&gt; ippsFFTGetBufSize_C_32f(pFFTSpec, &amp;amp;iBufferSize);&lt;BR /&gt;&lt;BR /&gt; pExtraBuffer = (char*)(ippMalloc(iBufferSize));&lt;BR /&gt;&lt;BR /&gt; for (int iSpectrum = 0; iSpectrum &amp;lt; 10; ++iSpectrum)&lt;BR /&gt; {&lt;BR /&gt; Sleep(0);&lt;BR /&gt; start = ippGetCpuClocks();&lt;BR /&gt; ippsFFTFwd_CToC_32f(pFloatPointers[0], pFloatPointers[1], pFloatPointers[10], pFloatPointers[11], pFFTSpec, pExtraBuffer);&lt;BR /&gt; end = ippGetCpuClocks();&lt;BR /&gt; *pTimes++ = end - start;&lt;BR /&gt;&lt;BR /&gt; Sleep(0);&lt;BR /&gt; start = ippGetCpuClocks();&lt;BR /&gt; ippsFFTFwd_CToC_32f(pFloatPointers[2], pFloatPointers[3], pFloatPointers[12], pFloatPointers[13], pFFTSpec, pExtraBuffer);&lt;BR /&gt; end = ippGetCpuClocks();&lt;BR /&gt; *pTimes++ = end - start;&lt;BR /&gt;&lt;BR /&gt; Sleep(0);&lt;BR /&gt; start = ippGetCpuClocks();&lt;BR /&gt; ippsFFTFwd_CToC_32f(pFloatPointers[4], pFloatPointers[5], pFloatPointers[14], pFloatPointers[15], pFFTSpec, pExtraBuffer);&lt;BR /&gt; end = ippGetCpuClocks();&lt;BR /&gt; *pTimes++ = end - start;&lt;BR /&gt;&lt;BR /&gt; Sleep(0);&lt;BR /&gt; start = ippGetCpuClocks();&lt;BR /&gt; ippsFFTFwd_CToC_32f(pFloatPointers[6], pFloatPointers[7], pFloatPointers[16], pFloatPointers[17], pFFTSpec, pExtraBuffer);&lt;BR /&gt; end = ippGetCpuClocks();&lt;BR /&gt; *pTimes++ = end - start;&lt;BR /&gt;&lt;BR /&gt; Sleep(0);&lt;BR /&gt; start = ippGetCpuClocks();&lt;BR /&gt; ippsFFTFwd_CToC_32f(pFloatPointers[8], pFloatPointers[9], pFloatPointers[18], pFloatPointers[19], pFFTSpec, pExtraBuffer);&lt;BR /&gt; end = ippGetCpuClocks();&lt;BR /&gt; *pTimes++ = end - start;&lt;BR /&gt; }&lt;BR /&gt;&lt;BR /&gt; // Release the FFT Specifation struture allocated earlier&lt;BR /&gt; ippsFFTFree_C_32f(pFFTSpec);&lt;BR /&gt;&lt;BR /&gt; double t2 = Now();&lt;BR /&gt;&lt;BR /&gt; ippFree(pExtraBuffer);&lt;BR /&gt;&lt;BR /&gt; i = 0;&lt;BR /&gt; while(i &amp;lt; 20)&lt;BR /&gt; {&lt;BR /&gt; ippFree(pFloatPointers[i++]);&lt;BR /&gt; }&lt;BR /&gt;&lt;BR /&gt; return double(t2 - t1) * 86400.0;&lt;BR /&gt;}&lt;BR /&gt;&lt;/I&gt;&lt;/P&gt;
&lt;P&gt;2. Perform 5 * 32K FFTs per second for 10 seconds. 1 Second sleep followed by 5 FFTs.&lt;/P&gt;
&lt;P&gt;double TForm1::FFT(Ipp64u* pTimes)&lt;BR /&gt;{&lt;BR /&gt; IppsFFTSpec_C_32f* pFFTSpec = 0;&lt;BR /&gt; int iBufferSize = 0;&lt;BR /&gt; float* pFloatPointers[20];&lt;BR /&gt; char* pExtraBuffer = 0;&lt;BR /&gt; int iFFTOrder = 15;&lt;BR /&gt; int iFFTSize = 32768;&lt;BR /&gt; Ipp64u start, end;&lt;BR /&gt;&lt;BR /&gt; int i = 0;&lt;BR /&gt; while(i &amp;lt; 20)&lt;BR /&gt; {&lt;BR /&gt; pFloatPointers&lt;I&gt; = (float*)ippMalloc(iFFTSize * sizeof(float));&lt;BR /&gt; ippsSet_32f(10.0, pFloatPointers[i++], iFFTSize);&lt;BR /&gt; }&lt;BR /&gt;&lt;BR /&gt; double t1 = Now();&lt;BR /&gt;&lt;BR /&gt; // Create the FFT Specification structure with the flags and hints we want&lt;BR /&gt; ippsFFTInitAlloc_C_32f(&amp;amp;pFFTSpec, iFFTOrder, IPP_FFT_NODIV_BY_ANY, ippAlgHintNone);&lt;BR /&gt;&lt;BR /&gt; // Now work out the size of external buffer we should allocate&lt;BR /&gt; // This buffer isn't necessary but FFT calls are faster if it's calculated up front&lt;BR /&gt; ippsFFTGetBufSize_C_32f(pFFTSpec, &amp;amp;iBufferSize);&lt;BR /&gt;&lt;BR /&gt; pExtraBuffer = (char*)(ippMalloc(iBufferSize));&lt;BR /&gt;&lt;BR /&gt; for (int iSpectrum = 0; iSpectrum &amp;lt; 10; ++iSpectrum)&lt;BR /&gt; {&lt;BR /&gt; Sleep(1000);&lt;BR /&gt; start = ippGetCpuClocks();&lt;BR /&gt; ippsFFTFwd_CToC_32f(pFloatPointers[0], pFloatPointers[1], pFloatPointers[10], pFloatPointers[11], pFFTSpec, pExtraBuffer);&lt;BR /&gt; end = ippGetCpuClocks();&lt;BR /&gt; *pTimes++ = end - start;&lt;BR /&gt;&lt;BR /&gt; Sleep(0);&lt;BR /&gt; start = ippGetCpuClocks();&lt;BR /&gt; ippsFFTFwd_CToC_32f(pFloatPointers[2], pFloatPointers[3], pFloatPointers[12], pFloatPointers[13], pFFTSpec, pExtraBuffer);&lt;BR /&gt; end = ippGetCpuClocks();&lt;BR /&gt; *pTimes++ = end - start;&lt;BR /&gt;&lt;BR /&gt; Sleep(0);&lt;BR /&gt; start = ippGetCpuClocks();&lt;BR /&gt; ippsFFTFwd_CToC_32f(pFloatPointers[4], pFloatPointers[5], pFloatPointers[14], pFloatPointers[15], pFFTSpec, pExtraBuffer);&lt;BR /&gt; end = ippGetCpuClocks();&lt;BR /&gt; *pTimes++ = end - start;&lt;BR /&gt;&lt;BR /&gt; Sleep(0);&lt;BR /&gt; start = ippGetCpuClocks();&lt;BR /&gt; ippsFFTFwd_CToC_32f(pFloatPointers[6], pFloatPointers[7], pFloatPointers[16], pFloatPointers[17], pFFTSpec, pExtraBuffer);&lt;BR /&gt; end = ippGetCpuClocks();&lt;BR /&gt; *pTimes++ = end - start;&lt;BR /&gt;&lt;BR /&gt; Sleep(0);&lt;BR /&gt; start = ippGetCpuClocks();&lt;BR /&gt; ippsFFTFwd_CToC_32f(pFloatPointers[8], pFloatPointers[9], pFloatPointers[18], pFloatPointers[19], pFFTSpec, pExtraBuffer);&lt;BR /&gt; end = ippGetCpuClocks();&lt;BR /&gt; *pTimes++ = end - start;&lt;BR /&gt; }&lt;BR /&gt;&lt;BR /&gt; // Release the FFT Specifation struture allocated earlier&lt;BR /&gt; ippsFFTFree_C_32f(pFFTSpec);&lt;BR /&gt;&lt;BR /&gt; double t2 = Now();&lt;BR /&gt;&lt;BR /&gt; ippFree(pExtraBuffer);&lt;BR /&gt;&lt;BR /&gt; i = 0;&lt;BR /&gt; while(i &amp;lt; 20)&lt;BR /&gt; {&lt;BR /&gt; ippFree(pFloatPointers[i++]);&lt;BR /&gt; }&lt;BR /&gt;&lt;BR /&gt; return double(t2 - t1) * 86400.0;&lt;BR /&gt;}&lt;BR /&gt;&lt;/I&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;3.Perform 5 * 32K FFTs per second for 10 seconds. 200ms sleep between each FFT.&lt;/P&gt;
&lt;P&gt;double TForm1::FFT(Ipp64u* pTimes)&lt;BR /&gt;{&lt;BR /&gt; IppsFFTSpec_C_32f* pFFTSpec = 0;&lt;BR /&gt; int iBufferSize = 0;&lt;BR /&gt; float* pFloatPointers[20];&lt;BR /&gt; char* pExtraBuffer = 0;&lt;BR /&gt; int iFFTOrder = 15;&lt;BR /&gt; int iFFTSize = 32768;&lt;BR /&gt; Ipp64u start, end;&lt;BR /&gt;&lt;BR /&gt; int i = 0;&lt;BR /&gt; while(i &amp;lt; 20)&lt;BR /&gt; {&lt;BR /&gt; pFloatPointers&lt;I&gt; = (float*)ippMalloc(iFFTSize * sizeof(float));&lt;BR /&gt; ippsSet_32f(10.0, pFloatPointers[i++], iFFTSize);&lt;BR /&gt; }&lt;BR /&gt;&lt;BR /&gt; double t1 = Now();&lt;BR /&gt;&lt;BR /&gt; // Create the FFT Specification structure with the flags and hints we want&lt;BR /&gt; ippsFFTInitAlloc_C_32f(&amp;amp;pFFTSpec, iFFTOrder, IPP_FFT_NODIV_BY_ANY, ippAlgHintNone);&lt;BR /&gt;&lt;BR /&gt; // Now work out the size of external buffer we should allocate&lt;BR /&gt; // This buffer isn't necessary but FFT calls are faster if it's calculated up front&lt;BR /&gt; ippsFFTGetBufSize_C_32f(pFFTSpec, &amp;amp;iBufferSize);&lt;BR /&gt;&lt;BR /&gt; pExtraBuffer = (char*)(ippMalloc(iBufferSize));&lt;BR /&gt;&lt;BR /&gt; for (int iSpectrum = 0; iSpectrum &amp;lt; 10; ++iSpectrum)&lt;BR /&gt; {&lt;BR /&gt; Sleep(200);&lt;BR /&gt; start = ippGetCpuClocks();&lt;BR /&gt; ippsFFTFwd_CToC_32f(pFloatPointers[0], pFloatPointers[1], pFloatPointers[10], pFloatPointers[11], pFFTSpec, pExtraBuffer);&lt;BR /&gt; end = ippGetCpuClocks();&lt;BR /&gt; *pTimes++ = end - start;&lt;BR /&gt;&lt;BR /&gt; Sleep(200);&lt;BR /&gt; start = ippGetCpuClocks();&lt;BR /&gt; ippsFFTFwd_CToC_32f(pFloatPointers[2], pFloatPointers[3], pFloatPointers[12], pFloatPointers[13], pFFTSpec, pExtraBuffer);&lt;BR /&gt; end = ippGetCpuClocks();&lt;BR /&gt; *pTimes++ = end - start;&lt;BR /&gt;&lt;BR /&gt; Sleep(200);&lt;BR /&gt; start = ippGetCpuClocks();&lt;BR /&gt; ippsFFTFwd_CToC_32f(pFloatPointers[4], pFloatPointers[5], pFloatPointers[14], pFloatPointers[15], pFFTSpec, pExtraBuffer);&lt;BR /&gt; end = ippGetCpuClocks();&lt;BR /&gt; *pTimes++ = end - start;&lt;BR /&gt;&lt;BR /&gt; Sleep(200);&lt;BR /&gt; start = ippGetCpuClocks();&lt;BR /&gt; ippsFFTFwd_CToC_32f(pFloatPointers[6], pFloatPointers[7], pFloatPointers[16], pFloatPointers[17], pFFTSpec, pExtraBuffer);&lt;BR /&gt; end = ippGetCpuClocks();&lt;BR /&gt; *pTimes++ = end - start;&lt;BR /&gt;&lt;BR /&gt; Sleep(200);&lt;BR /&gt; start = ippGetCpuClocks();&lt;BR /&gt; ippsFFTFwd_CToC_32f(pFloatPointers[8], pFloatPointers[9], pFloatPointers[18], pFloatPointers[19], pFFTSpec, pExtraBuffer);&lt;BR /&gt; end = ippGetCpuClocks();&lt;BR /&gt; *pTimes++ = end - start;&lt;BR /&gt; }&lt;BR /&gt;&lt;BR /&gt; // Release the FFT Specifation struture allocated earlier&lt;BR /&gt; ippsFFTFree_C_32f(pFFTSpec);&lt;BR /&gt;&lt;BR /&gt; double t2 = Now();&lt;BR /&gt;&lt;BR /&gt; ippFree(pExtraBuffer);&lt;BR /&gt;&lt;BR /&gt; i = 0;&lt;BR /&gt; while(i &amp;lt; 20)&lt;BR /&gt; {&lt;BR /&gt; ippFree(pFloatPointers[i++]);&lt;BR /&gt; }&lt;BR /&gt;&lt;BR /&gt; return double(t2 - t1) * 86400.0;&lt;BR /&gt;}&lt;BR /&gt;&lt;/I&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;The performance of these functions varies wildly as follows:&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;1.&lt;/P&gt;
&lt;P&gt;Approx Function execution time: 0.016s&lt;/P&gt;
&lt;P&gt;Average number of CPU Clocks per FFT: Approx 400,000&lt;/P&gt;
&lt;P&gt;CPU Load in Task Manager: Does not register&lt;/P&gt;
&lt;P&gt;2.&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;Approx Function execution time: 10s&lt;/P&gt;
&lt;P&gt;Average number of CPU Clocks per FFT: Approx 650,000&lt;/P&gt;
&lt;P&gt;CPU Load in Task Manager: Approx 5% for full 10 second duration&lt;/P&gt;
&lt;P&gt;3.&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;Approx Function execution time: 10.15s&lt;/P&gt;
&lt;P&gt;Average number of CPU Clocks per FFT: Varies from 750,000 to 1.5M&lt;/P&gt;
&lt;P&gt;CPU Load in Task Manager: 50% for full 10 second duration&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;So the problem is that basically when I space the FFTs equally over the course of 10 seconds the CPU just gets hammered. Can anyone please tell me why this is occuring and what I am doing incorrectly.&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;The background to this is that I develop high bandwidth data acquisition and real-time signal processing solutions for measuring vibration. Currently I am using the NSP libraries for all signal processing work but I want to migrate to IPP. Because the processing is real-time, it more closely resembles the 3rd function (FFTs performed periodically as data is acquired) but to be using 50% of the CPU to perform 5 FFTs per second is useless.&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;The above testing was performed on my development machine which is:&lt;/P&gt;
&lt;P&gt;Core 2 Duo E6750 2.66 GHz, 2 GB RAM, Win XP SP3&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;Thanks&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 09 Dec 2008 15:02:01 GMT</pubDate>
    <dc:creator>pwindle</dc:creator>
    <dc:date>2008-12-09T15:02:01Z</dc:date>
    <item>
      <title>High CPU Load with IPP FFTs</title>
      <link>https://community.intel.com/t5/Intel-Integrated-Performance/High-CPU-Load-with-IPP-FFTs/m-p/886234#M10844</link>
      <description>&lt;P&gt;I am having a problem when using IPP for performing FFTs. I have written a small test app that demonstrates the problem. Have a look at the following 3 varients of a function I have written:&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;1. Perform 50 * 32K FFTs in quick succession.&lt;/P&gt;
&lt;P&gt;double TForm1::FFT(Ipp64u* pTimes)&lt;BR /&gt;{&lt;BR /&gt; IppsFFTSpec_C_32f* pFFTSpec = 0;&lt;BR /&gt; int iBufferSize = 0;&lt;BR /&gt; float* pFloatPointers[20];&lt;BR /&gt; char* pExtraBuffer = 0;&lt;BR /&gt; int iFFTOrder = 15;&lt;BR /&gt; int iFFTSize = 32768;&lt;BR /&gt; Ipp64u start, end;&lt;BR /&gt;&lt;BR /&gt; int i = 0;&lt;BR /&gt; while(i &amp;lt; 20)&lt;BR /&gt; {&lt;BR /&gt; pFloatPointers&lt;I&gt; = (float*)ippMalloc(iFFTSize * sizeof(float));&lt;BR /&gt; ippsSet_32f(10.0, pFloatPointers[i++], iFFTSize);&lt;BR /&gt; }&lt;BR /&gt;&lt;BR /&gt; double t1 = Now();&lt;BR /&gt;&lt;BR /&gt; // Create the FFT Specification structure with the flags and hints we want&lt;BR /&gt; ippsFFTInitAlloc_C_32f(&amp;amp;pFFTSpec, iFFTOrder, IPP_FFT_NODIV_BY_ANY, ippAlgHintNone);&lt;BR /&gt;&lt;BR /&gt; // Now work out the size of external buffer we should allocate&lt;BR /&gt; // This buffer isn't necessary but FFT calls are faster if it's calculated up front&lt;BR /&gt; ippsFFTGetBufSize_C_32f(pFFTSpec, &amp;amp;iBufferSize);&lt;BR /&gt;&lt;BR /&gt; pExtraBuffer = (char*)(ippMalloc(iBufferSize));&lt;BR /&gt;&lt;BR /&gt; for (int iSpectrum = 0; iSpectrum &amp;lt; 10; ++iSpectrum)&lt;BR /&gt; {&lt;BR /&gt; Sleep(0);&lt;BR /&gt; start = ippGetCpuClocks();&lt;BR /&gt; ippsFFTFwd_CToC_32f(pFloatPointers[0], pFloatPointers[1], pFloatPointers[10], pFloatPointers[11], pFFTSpec, pExtraBuffer);&lt;BR /&gt; end = ippGetCpuClocks();&lt;BR /&gt; *pTimes++ = end - start;&lt;BR /&gt;&lt;BR /&gt; Sleep(0);&lt;BR /&gt; start = ippGetCpuClocks();&lt;BR /&gt; ippsFFTFwd_CToC_32f(pFloatPointers[2], pFloatPointers[3], pFloatPointers[12], pFloatPointers[13], pFFTSpec, pExtraBuffer);&lt;BR /&gt; end = ippGetCpuClocks();&lt;BR /&gt; *pTimes++ = end - start;&lt;BR /&gt;&lt;BR /&gt; Sleep(0);&lt;BR /&gt; start = ippGetCpuClocks();&lt;BR /&gt; ippsFFTFwd_CToC_32f(pFloatPointers[4], pFloatPointers[5], pFloatPointers[14], pFloatPointers[15], pFFTSpec, pExtraBuffer);&lt;BR /&gt; end = ippGetCpuClocks();&lt;BR /&gt; *pTimes++ = end - start;&lt;BR /&gt;&lt;BR /&gt; Sleep(0);&lt;BR /&gt; start = ippGetCpuClocks();&lt;BR /&gt; ippsFFTFwd_CToC_32f(pFloatPointers[6], pFloatPointers[7], pFloatPointers[16], pFloatPointers[17], pFFTSpec, pExtraBuffer);&lt;BR /&gt; end = ippGetCpuClocks();&lt;BR /&gt; *pTimes++ = end - start;&lt;BR /&gt;&lt;BR /&gt; Sleep(0);&lt;BR /&gt; start = ippGetCpuClocks();&lt;BR /&gt; ippsFFTFwd_CToC_32f(pFloatPointers[8], pFloatPointers[9], pFloatPointers[18], pFloatPointers[19], pFFTSpec, pExtraBuffer);&lt;BR /&gt; end = ippGetCpuClocks();&lt;BR /&gt; *pTimes++ = end - start;&lt;BR /&gt; }&lt;BR /&gt;&lt;BR /&gt; // Release the FFT Specifation struture allocated earlier&lt;BR /&gt; ippsFFTFree_C_32f(pFFTSpec);&lt;BR /&gt;&lt;BR /&gt; double t2 = Now();&lt;BR /&gt;&lt;BR /&gt; ippFree(pExtraBuffer);&lt;BR /&gt;&lt;BR /&gt; i = 0;&lt;BR /&gt; while(i &amp;lt; 20)&lt;BR /&gt; {&lt;BR /&gt; ippFree(pFloatPointers[i++]);&lt;BR /&gt; }&lt;BR /&gt;&lt;BR /&gt; return double(t2 - t1) * 86400.0;&lt;BR /&gt;}&lt;BR /&gt;&lt;/I&gt;&lt;/P&gt;
&lt;P&gt;2. Perform 5 * 32K FFTs per second for 10 seconds. 1 Second sleep followed by 5 FFTs.&lt;/P&gt;
&lt;P&gt;double TForm1::FFT(Ipp64u* pTimes)&lt;BR /&gt;{&lt;BR /&gt; IppsFFTSpec_C_32f* pFFTSpec = 0;&lt;BR /&gt; int iBufferSize = 0;&lt;BR /&gt; float* pFloatPointers[20];&lt;BR /&gt; char* pExtraBuffer = 0;&lt;BR /&gt; int iFFTOrder = 15;&lt;BR /&gt; int iFFTSize = 32768;&lt;BR /&gt; Ipp64u start, end;&lt;BR /&gt;&lt;BR /&gt; int i = 0;&lt;BR /&gt; while(i &amp;lt; 20)&lt;BR /&gt; {&lt;BR /&gt; pFloatPointers&lt;I&gt; = (float*)ippMalloc(iFFTSize * sizeof(float));&lt;BR /&gt; ippsSet_32f(10.0, pFloatPointers[i++], iFFTSize);&lt;BR /&gt; }&lt;BR /&gt;&lt;BR /&gt; double t1 = Now();&lt;BR /&gt;&lt;BR /&gt; // Create the FFT Specification structure with the flags and hints we want&lt;BR /&gt; ippsFFTInitAlloc_C_32f(&amp;amp;pFFTSpec, iFFTOrder, IPP_FFT_NODIV_BY_ANY, ippAlgHintNone);&lt;BR /&gt;&lt;BR /&gt; // Now work out the size of external buffer we should allocate&lt;BR /&gt; // This buffer isn't necessary but FFT calls are faster if it's calculated up front&lt;BR /&gt; ippsFFTGetBufSize_C_32f(pFFTSpec, &amp;amp;iBufferSize);&lt;BR /&gt;&lt;BR /&gt; pExtraBuffer = (char*)(ippMalloc(iBufferSize));&lt;BR /&gt;&lt;BR /&gt; for (int iSpectrum = 0; iSpectrum &amp;lt; 10; ++iSpectrum)&lt;BR /&gt; {&lt;BR /&gt; Sleep(1000);&lt;BR /&gt; start = ippGetCpuClocks();&lt;BR /&gt; ippsFFTFwd_CToC_32f(pFloatPointers[0], pFloatPointers[1], pFloatPointers[10], pFloatPointers[11], pFFTSpec, pExtraBuffer);&lt;BR /&gt; end = ippGetCpuClocks();&lt;BR /&gt; *pTimes++ = end - start;&lt;BR /&gt;&lt;BR /&gt; Sleep(0);&lt;BR /&gt; start = ippGetCpuClocks();&lt;BR /&gt; ippsFFTFwd_CToC_32f(pFloatPointers[2], pFloatPointers[3], pFloatPointers[12], pFloatPointers[13], pFFTSpec, pExtraBuffer);&lt;BR /&gt; end = ippGetCpuClocks();&lt;BR /&gt; *pTimes++ = end - start;&lt;BR /&gt;&lt;BR /&gt; Sleep(0);&lt;BR /&gt; start = ippGetCpuClocks();&lt;BR /&gt; ippsFFTFwd_CToC_32f(pFloatPointers[4], pFloatPointers[5], pFloatPointers[14], pFloatPointers[15], pFFTSpec, pExtraBuffer);&lt;BR /&gt; end = ippGetCpuClocks();&lt;BR /&gt; *pTimes++ = end - start;&lt;BR /&gt;&lt;BR /&gt; Sleep(0);&lt;BR /&gt; start = ippGetCpuClocks();&lt;BR /&gt; ippsFFTFwd_CToC_32f(pFloatPointers[6], pFloatPointers[7], pFloatPointers[16], pFloatPointers[17], pFFTSpec, pExtraBuffer);&lt;BR /&gt; end = ippGetCpuClocks();&lt;BR /&gt; *pTimes++ = end - start;&lt;BR /&gt;&lt;BR /&gt; Sleep(0);&lt;BR /&gt; start = ippGetCpuClocks();&lt;BR /&gt; ippsFFTFwd_CToC_32f(pFloatPointers[8], pFloatPointers[9], pFloatPointers[18], pFloatPointers[19], pFFTSpec, pExtraBuffer);&lt;BR /&gt; end = ippGetCpuClocks();&lt;BR /&gt; *pTimes++ = end - start;&lt;BR /&gt; }&lt;BR /&gt;&lt;BR /&gt; // Release the FFT Specifation struture allocated earlier&lt;BR /&gt; ippsFFTFree_C_32f(pFFTSpec);&lt;BR /&gt;&lt;BR /&gt; double t2 = Now();&lt;BR /&gt;&lt;BR /&gt; ippFree(pExtraBuffer);&lt;BR /&gt;&lt;BR /&gt; i = 0;&lt;BR /&gt; while(i &amp;lt; 20)&lt;BR /&gt; {&lt;BR /&gt; ippFree(pFloatPointers[i++]);&lt;BR /&gt; }&lt;BR /&gt;&lt;BR /&gt; return double(t2 - t1) * 86400.0;&lt;BR /&gt;}&lt;BR /&gt;&lt;/I&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;3.Perform 5 * 32K FFTs per second for 10 seconds. 200ms sleep between each FFT.&lt;/P&gt;
&lt;P&gt;double TForm1::FFT(Ipp64u* pTimes)&lt;BR /&gt;{&lt;BR /&gt; IppsFFTSpec_C_32f* pFFTSpec = 0;&lt;BR /&gt; int iBufferSize = 0;&lt;BR /&gt; float* pFloatPointers[20];&lt;BR /&gt; char* pExtraBuffer = 0;&lt;BR /&gt; int iFFTOrder = 15;&lt;BR /&gt; int iFFTSize = 32768;&lt;BR /&gt; Ipp64u start, end;&lt;BR /&gt;&lt;BR /&gt; int i = 0;&lt;BR /&gt; while(i &amp;lt; 20)&lt;BR /&gt; {&lt;BR /&gt; pFloatPointers&lt;I&gt; = (float*)ippMalloc(iFFTSize * sizeof(float));&lt;BR /&gt; ippsSet_32f(10.0, pFloatPointers[i++], iFFTSize);&lt;BR /&gt; }&lt;BR /&gt;&lt;BR /&gt; double t1 = Now();&lt;BR /&gt;&lt;BR /&gt; // Create the FFT Specification structure with the flags and hints we want&lt;BR /&gt; ippsFFTInitAlloc_C_32f(&amp;amp;pFFTSpec, iFFTOrder, IPP_FFT_NODIV_BY_ANY, ippAlgHintNone);&lt;BR /&gt;&lt;BR /&gt; // Now work out the size of external buffer we should allocate&lt;BR /&gt; // This buffer isn't necessary but FFT calls are faster if it's calculated up front&lt;BR /&gt; ippsFFTGetBufSize_C_32f(pFFTSpec, &amp;amp;iBufferSize);&lt;BR /&gt;&lt;BR /&gt; pExtraBuffer = (char*)(ippMalloc(iBufferSize));&lt;BR /&gt;&lt;BR /&gt; for (int iSpectrum = 0; iSpectrum &amp;lt; 10; ++iSpectrum)&lt;BR /&gt; {&lt;BR /&gt; Sleep(200);&lt;BR /&gt; start = ippGetCpuClocks();&lt;BR /&gt; ippsFFTFwd_CToC_32f(pFloatPointers[0], pFloatPointers[1], pFloatPointers[10], pFloatPointers[11], pFFTSpec, pExtraBuffer);&lt;BR /&gt; end = ippGetCpuClocks();&lt;BR /&gt; *pTimes++ = end - start;&lt;BR /&gt;&lt;BR /&gt; Sleep(200);&lt;BR /&gt; start = ippGetCpuClocks();&lt;BR /&gt; ippsFFTFwd_CToC_32f(pFloatPointers[2], pFloatPointers[3], pFloatPointers[12], pFloatPointers[13], pFFTSpec, pExtraBuffer);&lt;BR /&gt; end = ippGetCpuClocks();&lt;BR /&gt; *pTimes++ = end - start;&lt;BR /&gt;&lt;BR /&gt; Sleep(200);&lt;BR /&gt; start = ippGetCpuClocks();&lt;BR /&gt; ippsFFTFwd_CToC_32f(pFloatPointers[4], pFloatPointers[5], pFloatPointers[14], pFloatPointers[15], pFFTSpec, pExtraBuffer);&lt;BR /&gt; end = ippGetCpuClocks();&lt;BR /&gt; *pTimes++ = end - start;&lt;BR /&gt;&lt;BR /&gt; Sleep(200);&lt;BR /&gt; start = ippGetCpuClocks();&lt;BR /&gt; ippsFFTFwd_CToC_32f(pFloatPointers[6], pFloatPointers[7], pFloatPointers[16], pFloatPointers[17], pFFTSpec, pExtraBuffer);&lt;BR /&gt; end = ippGetCpuClocks();&lt;BR /&gt; *pTimes++ = end - start;&lt;BR /&gt;&lt;BR /&gt; Sleep(200);&lt;BR /&gt; start = ippGetCpuClocks();&lt;BR /&gt; ippsFFTFwd_CToC_32f(pFloatPointers[8], pFloatPointers[9], pFloatPointers[18], pFloatPointers[19], pFFTSpec, pExtraBuffer);&lt;BR /&gt; end = ippGetCpuClocks();&lt;BR /&gt; *pTimes++ = end - start;&lt;BR /&gt; }&lt;BR /&gt;&lt;BR /&gt; // Release the FFT Specifation struture allocated earlier&lt;BR /&gt; ippsFFTFree_C_32f(pFFTSpec);&lt;BR /&gt;&lt;BR /&gt; double t2 = Now();&lt;BR /&gt;&lt;BR /&gt; ippFree(pExtraBuffer);&lt;BR /&gt;&lt;BR /&gt; i = 0;&lt;BR /&gt; while(i &amp;lt; 20)&lt;BR /&gt; {&lt;BR /&gt; ippFree(pFloatPointers[i++]);&lt;BR /&gt; }&lt;BR /&gt;&lt;BR /&gt; return double(t2 - t1) * 86400.0;&lt;BR /&gt;}&lt;BR /&gt;&lt;/I&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;The performance of these functions varies wildly as follows:&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;1.&lt;/P&gt;
&lt;P&gt;Approx Function execution time: 0.016s&lt;/P&gt;
&lt;P&gt;Average number of CPU Clocks per FFT: Approx 400,000&lt;/P&gt;
&lt;P&gt;CPU Load in Task Manager: Does not register&lt;/P&gt;
&lt;P&gt;2.&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;Approx Function execution time: 10s&lt;/P&gt;
&lt;P&gt;Average number of CPU Clocks per FFT: Approx 650,000&lt;/P&gt;
&lt;P&gt;CPU Load in Task Manager: Approx 5% for full 10 second duration&lt;/P&gt;
&lt;P&gt;3.&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;Approx Function execution time: 10.15s&lt;/P&gt;
&lt;P&gt;Average number of CPU Clocks per FFT: Varies from 750,000 to 1.5M&lt;/P&gt;
&lt;P&gt;CPU Load in Task Manager: 50% for full 10 second duration&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;So the problem is that basically when I space the FFTs equally over the course of 10 seconds the CPU just gets hammered. Can anyone please tell me why this is occuring and what I am doing incorrectly.&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;The background to this is that I develop high bandwidth data acquisition and real-time signal processing solutions for measuring vibration. Currently I am using the NSP libraries for all signal processing work but I want to migrate to IPP. Because the processing is real-time, it more closely resembles the 3rd function (FFTs performed periodically as data is acquired) but to be using 50% of the CPU to perform 5 FFTs per second is useless.&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;The above testing was performed on my development machine which is:&lt;/P&gt;
&lt;P&gt;Core 2 Duo E6750 2.66 GHz, 2 GB RAM, Win XP SP3&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;Thanks&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 09 Dec 2008 15:02:01 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Integrated-Performance/High-CPU-Load-with-IPP-FFTs/m-p/886234#M10844</guid>
      <dc:creator>pwindle</dc:creator>
      <dc:date>2008-12-09T15:02:01Z</dc:date>
    </item>
    <item>
      <title>Re: High CPU Load with IPP FFTs</title>
      <link>https://community.intel.com/t5/Intel-Integrated-Performance/High-CPU-Load-with-IPP-FFTs/m-p/886235#M10845</link>
      <description>&lt;DIV style="margin:0px;"&gt;&lt;/DIV&gt;
&lt;P&gt;Sorry for lack of code formatting. Formatting tool didn't work so I just pasted the code in normally.&lt;/P&gt;</description>
      <pubDate>Tue, 09 Dec 2008 15:09:10 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Integrated-Performance/High-CPU-Load-with-IPP-FFTs/m-p/886235#M10845</guid>
      <dc:creator>pwindle</dc:creator>
      <dc:date>2008-12-09T15:09:10Z</dc:date>
    </item>
    <item>
      <title>Re: High CPU Load with IPP FFTs</title>
      <link>https://community.intel.com/t5/Intel-Integrated-Performance/High-CPU-Load-with-IPP-FFTs/m-p/886236#M10846</link>
      <description>&lt;DIV style="margin:0px;"&gt;OpenMP threads still active for some time after they are finish real work, that is why you see higher cpu usage. The recomenation is to call ippSetNumThreads(1) to limit number threads created by IPP (or link with IPP not threaded static libraries)&lt;/DIV&gt;
&lt;DIV style="margin:0px;"&gt;Regards,&lt;BR /&gt; Vladimir&lt;/DIV&gt;
&lt;DIV style="margin:0px;"&gt;&lt;/DIV&gt;
&lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 11 Dec 2008 05:50:03 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Integrated-Performance/High-CPU-Load-with-IPP-FFTs/m-p/886236#M10846</guid>
      <dc:creator>Vladimir_Dudnik</dc:creator>
      <dc:date>2008-12-11T05:50:03Z</dc:date>
    </item>
    <item>
      <title>Re: High CPU Load with IPP FFTs</title>
      <link>https://community.intel.com/t5/Intel-Integrated-Performance/High-CPU-Load-with-IPP-FFTs/m-p/886237#M10847</link>
      <description>&lt;DIV style="margin:0px;"&gt;
&lt;DIV id="quote_reply" style="margin-top: 5px; width: 100%;"&gt;
&lt;DIV style="margin-left:2px;margin-right:2px;"&gt;Quoting - &lt;A href="https://community.intel.com/en-us/profile/61463"&gt;vdudnik&lt;/A&gt;&lt;/DIV&gt;
&lt;DIV style="background-color:#E5E5E5; padding:5px;border: 1px; border-style: inset;margin-left:2px;margin-right:2px;"&gt;&lt;EM&gt;
&lt;DIV style="margin:0px;"&gt;OpenMP threads still active for some time after they are finish real work, that is why you see higher cpu usage. The recomenation is to call ippSetNumThreads(1) to limit number threads created by IPP (or link with IPP not threaded static libraries)&lt;/DIV&gt;
&lt;DIV style="margin:0px;"&gt;Regards,&lt;BR /&gt; Vladimir&lt;/DIV&gt;
&lt;P&gt;&lt;/P&gt;
&lt;/EM&gt;&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;P&gt;Just wanted to say thanks very much, ippSetNumThreads(1) fixed it great.&lt;/P&gt;</description>
      <pubDate>Thu, 18 Dec 2008 08:17:06 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Integrated-Performance/High-CPU-Load-with-IPP-FFTs/m-p/886237#M10847</guid>
      <dc:creator>pwindle</dc:creator>
      <dc:date>2008-12-18T08:17:06Z</dc:date>
    </item>
    <item>
      <title>Re: High CPU Load with IPP FFTs</title>
      <link>https://community.intel.com/t5/Intel-Integrated-Performance/High-CPU-Load-with-IPP-FFTs/m-p/886238#M10848</link>
      <description>&lt;DIV style="margin:0px;"&gt;&lt;/DIV&gt;
&lt;P&gt;you are welcome:)&lt;/P&gt;</description>
      <pubDate>Thu, 18 Dec 2008 08:20:19 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Integrated-Performance/High-CPU-Load-with-IPP-FFTs/m-p/886238#M10848</guid>
      <dc:creator>Vladimir_Dudnik</dc:creator>
      <dc:date>2008-12-18T08:20:19Z</dc:date>
    </item>
    <item>
      <title>Re: High CPU Load with IPP FFTs</title>
      <link>https://community.intel.com/t5/Intel-Integrated-Performance/High-CPU-Load-with-IPP-FFTs/m-p/886239#M10849</link>
      <description>&lt;DIV&gt;&lt;/DIV&gt;
&lt;DIV style="margin:0px;"&gt;To me, limiting execution to one thread is not a great solution, because I need to balance execution over 4 cores. With moremulti-core processors coming within the next two years, this is a key thing.&lt;/DIV&gt;
&lt;DIV style="margin:0px;"&gt;&lt;/DIV&gt;
&lt;DIV style="margin:0px;"&gt;It seems there is either an underlying defect or that we need to call some function that 'cleans up' openMP stuff. Is there such a call?&lt;/DIV&gt;
&lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 23 Dec 2008 19:11:56 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Integrated-Performance/High-CPU-Load-with-IPP-FFTs/m-p/886239#M10849</guid>
      <dc:creator>brian-womack</dc:creator>
      <dc:date>2008-12-23T19:11:56Z</dc:date>
    </item>
    <item>
      <title>Re: High CPU Load with IPP FFTs</title>
      <link>https://community.intel.com/t5/Intel-Integrated-Performance/High-CPU-Load-with-IPP-FFTs/m-p/886240#M10850</link>
      <description>&lt;DIV style="margin:0px;"&gt;&lt;/DIV&gt;
&lt;P&gt;This is not about defect. When you combine OpenMP threading with Win32 Sleep function the system behaves in this way.Whenyou decide to use IPP internal threading you need to carefully use system threading on top of IPP threads. Alternatively you may disable IPP threading and parallelize your task on top of IPP calls with whatever threading API.&lt;/P&gt;</description>
      <pubDate>Tue, 23 Dec 2008 19:24:51 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Integrated-Performance/High-CPU-Load-with-IPP-FFTs/m-p/886240#M10850</guid>
      <dc:creator>Vladimir_Dudnik</dc:creator>
      <dc:date>2008-12-23T19:24:51Z</dc:date>
    </item>
  </channel>
</rss>

