<?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>topic integral problem in Intel® Integrated Performance Primitives</title>
    <link>https://community.intel.com/t5/Intel-Integrated-Performance/integral-problem/m-p/979755#M21298</link>
    <description>&lt;P&gt;Good morning dear all,&lt;/P&gt;
&lt;P&gt;I'm currently using ippiSqrIntegral_8u32f64f_C1R to compute integral and square integral of an image. The square integral double array resulted seem to be right but it's not the case for the float integral array. So i decided to experiment the function in a simple 512x512 image entirely filled with 255 value. With this case, I expect that every value of integral array is gonna finish with "5" or "0" as it is a sum of 255 values... but i&amp;nbsp; notice that some values can finish with "4" or "7", etc... errors occur between (126,508) and (513,508)&amp;nbsp; .Here is my problem, because even if i'm wrong with the function paramters, it cannot gives float finishing with value other than "0" or "5". Thanks for any help&lt;/P&gt;
&lt;P&gt;Here is my code :&lt;/P&gt;
&lt;P&gt;#include &amp;lt;vector&amp;gt;&lt;/P&gt;
&lt;P&gt;int main(){&lt;/P&gt;
&lt;P&gt;std::vector&amp;lt;unsigned char&amp;gt; white(512*512,255);&lt;/P&gt;
&lt;P&gt;Ipp8u* src = &amp;amp;white[0];&lt;/P&gt;
&lt;P&gt;int step = 0;&lt;/P&gt;
&lt;P&gt;Ipp32f* integral = ippiMalloc_32f_C1(512+1,521+1,&amp;amp;step);&lt;BR /&gt;Ipp64f* integral2 = (double*)malloc((512+1)*(512+1)*sizeof(double));&lt;/P&gt;
&lt;P&gt;IppiSize roi = {w+2*R,h+2*R};&lt;BR /&gt;st = ippiSqrIntegral_8u32f64f_C1R(src,512*sizeof(Ipp8u),integral,(512+1)*sizeof(Ipp32f),integral2,(512+1)*sizeof(double),roi,0,0);&lt;/P&gt;
&lt;P&gt;if(st!=ippStsNoErr)&lt;BR /&gt;{&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;std::cout &amp;lt;&amp;lt; ippGetStatusString(st) &amp;lt;&amp;lt; std::endl;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;return 1;&lt;BR /&gt;}&lt;/P&gt;
&lt;P&gt;for(int i=0 ; i&amp;lt;512+1 ; i++)&lt;/P&gt;
&lt;P&gt;for(int j=0 ; j&amp;lt;512+1 ; j++)&lt;/P&gt;
&lt;P&gt;{&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if(*(integral + i*(512+1) + j)%5 != 0)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; {&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; std::cout &amp;lt;&amp;lt; i &amp;lt;&amp;lt; "," &amp;lt;&amp;lt; j &amp;lt;&amp;lt; std::endl;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; system("PAUSE");&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; }&lt;/P&gt;
&lt;P&gt;}&lt;/P&gt;
&lt;P&gt;return 0;&lt;/P&gt;
&lt;P&gt;}&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 03 Jun 2013 15:19:37 GMT</pubDate>
    <dc:creator>Youcef_K_</dc:creator>
    <dc:date>2013-06-03T15:19:37Z</dc:date>
    <item>
      <title>integral problem</title>
      <link>https://community.intel.com/t5/Intel-Integrated-Performance/integral-problem/m-p/979755#M21298</link>
      <description>&lt;P&gt;Good morning dear all,&lt;/P&gt;
&lt;P&gt;I'm currently using ippiSqrIntegral_8u32f64f_C1R to compute integral and square integral of an image. The square integral double array resulted seem to be right but it's not the case for the float integral array. So i decided to experiment the function in a simple 512x512 image entirely filled with 255 value. With this case, I expect that every value of integral array is gonna finish with "5" or "0" as it is a sum of 255 values... but i&amp;nbsp; notice that some values can finish with "4" or "7", etc... errors occur between (126,508) and (513,508)&amp;nbsp; .Here is my problem, because even if i'm wrong with the function paramters, it cannot gives float finishing with value other than "0" or "5". Thanks for any help&lt;/P&gt;
&lt;P&gt;Here is my code :&lt;/P&gt;
&lt;P&gt;#include &amp;lt;vector&amp;gt;&lt;/P&gt;
&lt;P&gt;int main(){&lt;/P&gt;
&lt;P&gt;std::vector&amp;lt;unsigned char&amp;gt; white(512*512,255);&lt;/P&gt;
&lt;P&gt;Ipp8u* src = &amp;amp;white[0];&lt;/P&gt;
&lt;P&gt;int step = 0;&lt;/P&gt;
&lt;P&gt;Ipp32f* integral = ippiMalloc_32f_C1(512+1,521+1,&amp;amp;step);&lt;BR /&gt;Ipp64f* integral2 = (double*)malloc((512+1)*(512+1)*sizeof(double));&lt;/P&gt;
&lt;P&gt;IppiSize roi = {w+2*R,h+2*R};&lt;BR /&gt;st = ippiSqrIntegral_8u32f64f_C1R(src,512*sizeof(Ipp8u),integral,(512+1)*sizeof(Ipp32f),integral2,(512+1)*sizeof(double),roi,0,0);&lt;/P&gt;
&lt;P&gt;if(st!=ippStsNoErr)&lt;BR /&gt;{&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;std::cout &amp;lt;&amp;lt; ippGetStatusString(st) &amp;lt;&amp;lt; std::endl;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;return 1;&lt;BR /&gt;}&lt;/P&gt;
&lt;P&gt;for(int i=0 ; i&amp;lt;512+1 ; i++)&lt;/P&gt;
&lt;P&gt;for(int j=0 ; j&amp;lt;512+1 ; j++)&lt;/P&gt;
&lt;P&gt;{&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if(*(integral + i*(512+1) + j)%5 != 0)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; {&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; std::cout &amp;lt;&amp;lt; i &amp;lt;&amp;lt; "," &amp;lt;&amp;lt; j &amp;lt;&amp;lt; std::endl;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; system("PAUSE");&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; }&lt;/P&gt;
&lt;P&gt;}&lt;/P&gt;
&lt;P&gt;return 0;&lt;/P&gt;
&lt;P&gt;}&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 03 Jun 2013 15:19:37 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Integrated-Performance/integral-problem/m-p/979755#M21298</guid>
      <dc:creator>Youcef_K_</dc:creator>
      <dc:date>2013-06-03T15:19:37Z</dc:date>
    </item>
    <item>
      <title>Sorry it is :</title>
      <link>https://community.intel.com/t5/Intel-Integrated-Performance/integral-problem/m-p/979756#M21299</link>
      <description>&lt;P&gt;Sorry it is :&lt;/P&gt;
&lt;P&gt;IppiSize roi = {512,512};&lt;/P&gt;</description>
      <pubDate>Mon, 03 Jun 2013 15:21:25 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Integrated-Performance/integral-problem/m-p/979756#M21299</guid>
      <dc:creator>Youcef_K_</dc:creator>
      <dc:date>2013-06-03T15:21:25Z</dc:date>
    </item>
    <item>
      <title>What version ( update ) of</title>
      <link>https://community.intel.com/t5/Intel-Integrated-Performance/integral-problem/m-p/979757#M21300</link>
      <description>What version ( update ) of IPP are you using?

&amp;gt;&amp;gt;...some values can finish with "4" or "7", etc... errors occur between (126,508) and (513,508)...

Please attach a txt-file with a complete output of the test application. Thanks.</description>
      <pubDate>Tue, 04 Jun 2013 01:03:37 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Integrated-Performance/integral-problem/m-p/979757#M21300</guid>
      <dc:creator>SergeyKostrov</dc:creator>
      <dc:date>2013-06-04T01:03:37Z</dc:date>
    </item>
    <item>
      <title>I run w_ipp_7.1.1.119.exe to</title>
      <link>https://community.intel.com/t5/Intel-Integrated-Performance/integral-problem/m-p/979758#M21301</link>
      <description>&lt;P&gt;I run w_ipp_7.1.1.119.exe to install ipp.&lt;/P&gt;
&lt;P&gt;Here attached, you'll find the .cpp and corresponding command window output in output.txt. I notice that the problem appears for square matrices bigger than 256x256.&lt;/P&gt;
&lt;P&gt;thankls&lt;/P&gt;
&lt;P&gt;thanks&lt;/P&gt;</description>
      <pubDate>Tue, 04 Jun 2013 08:06:12 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Integrated-Performance/integral-problem/m-p/979758#M21301</guid>
      <dc:creator>Youcef_K_</dc:creator>
      <dc:date>2013-06-04T08:06:12Z</dc:date>
    </item>
    <item>
      <title>Thanks for the output.txt</title>
      <link>https://community.intel.com/t5/Intel-Integrated-Performance/integral-problem/m-p/979759#M21302</link>
      <description>Thanks for the output.txt file. However, I can not see your problem:

&amp;gt;&amp;gt;...some values can finish with "4" or "7", etc... errors occur between (126,508) and (513,508)...

and there are no any substrings &lt;STRONG&gt;126,508&lt;/STRONG&gt; or &lt;STRONG&gt;513,508&lt;/STRONG&gt; in the file.</description>
      <pubDate>Tue, 04 Jun 2013 12:56:07 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Integrated-Performance/integral-problem/m-p/979759#M21302</guid>
      <dc:creator>SergeyKostrov</dc:creator>
      <dc:date>2013-06-04T12:56:07Z</dc:date>
    </item>
    <item>
      <title>I just copy-pasted the ouput</title>
      <link>https://community.intel.com/t5/Intel-Integrated-Performance/integral-problem/m-p/979760#M21303</link>
      <description>&lt;P&gt;I just copy-pasted the ouput of command window but the buffer of this window is not big enough to contain all value (it begins only from i=493,j=310). So, i now write directly values in .txt. Please find attached the corresponding output.txt and the .cpp file (where you can change the size of matrix and regenerate output.txt). I don't know why but now , first wrong value occurs at i=129,j=511 (not 126,508) and last one occurs at i=512,j=321 (not 513,508).&lt;/P&gt;
&lt;P&gt;Thanks for you help.&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 04 Jun 2013 13:24:18 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Integrated-Performance/integral-problem/m-p/979760#M21303</guid>
      <dc:creator>Youcef_K_</dc:creator>
      <dc:date>2013-06-04T13:24:18Z</dc:date>
    </item>
    <item>
      <title>Hi Sergey, any news about</title>
      <link>https://community.intel.com/t5/Intel-Integrated-Performance/integral-problem/m-p/979761#M21304</link>
      <description>&lt;P&gt;Hi Sergey, any news about integral function... thanks a lot for your help&lt;/P&gt;</description>
      <pubDate>Fri, 07 Jun 2013 09:14:21 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Integrated-Performance/integral-problem/m-p/979761#M21304</guid>
      <dc:creator>Youcef_K_</dc:creator>
      <dc:date>2013-06-07T09:14:21Z</dc:date>
    </item>
    <item>
      <title>Hi Youcef,</title>
      <link>https://community.intel.com/t5/Intel-Integrated-Performance/integral-problem/m-p/979762#M21305</link>
      <description>&lt;P&gt;Hi Youcef,&lt;/P&gt;
&lt;P&gt;Due to limited width of Ipp32f fraction we cannot expect, that adding 255 to Ipp32f value we'll be getting multiple of 5 indefinitely. Look at the code:&lt;/P&gt;
&lt;P&gt;[cpp]&lt;BR /&gt;&amp;nbsp; &amp;nbsp; Ipp32f sum = 0.;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; int i;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; for(i = 0; i &amp;lt; 512*512; i++) {&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; sum += (Ipp32f) 255;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if((sum/5 - (int)(sum/5)) != 0) {&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; printf("i=%d, sum=%f\n", i, sum);&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; break;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;BR /&gt;&amp;nbsp; &amp;nbsp; }&lt;BR /&gt;[/cpp]&lt;BR /&gt;We'll get:&lt;BR /&gt;&amp;nbsp; &amp;nbsp;i=65794, sum=16777724.000000&amp;nbsp;&lt;BR /&gt;65794/512 &amp;nbsp;= 128.5. I.e. that starting on 129 row you will be not getting 5 or 0 at the end of integral value. That's limitation. If you initialize your src with 5 (instead of 255), you'll get more or less good result.&lt;/P&gt;
&lt;P&gt;Regards,&lt;BR /&gt;Sergey&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 10 Jun 2013 06:39:47 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Integrated-Performance/integral-problem/m-p/979762#M21305</guid>
      <dc:creator>Sergey_K_Intel</dc:creator>
      <dc:date>2013-06-10T06:39:47Z</dc:date>
    </item>
    <item>
      <title>Thanks Sergey, it sounds</title>
      <link>https://community.intel.com/t5/Intel-Integrated-Performance/integral-problem/m-p/979763#M21306</link>
      <description>&lt;P&gt;Thanks Sergey, it sounds clear for me now.&lt;/P&gt;</description>
      <pubDate>Mon, 10 Jun 2013 12:29:20 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Integrated-Performance/integral-problem/m-p/979763#M21306</guid>
      <dc:creator>Youcef_K_</dc:creator>
      <dc:date>2013-06-10T12:29:20Z</dc:date>
    </item>
    <item>
      <title>&gt;&gt;...Due to limited width of</title>
      <link>https://community.intel.com/t5/Intel-Integrated-Performance/integral-problem/m-p/979764#M21307</link>
      <description>&amp;gt;&amp;gt;...Due to limited width of Ipp32f fraction we cannot expect, that adding 255 to Ipp32f value we'll be getting
&amp;gt;&amp;gt;multiple of 5 indefinitely...

I did a quick test and I changed 'float a' to 'double a' in a test case 'integral-ipp-test.cpp'. Take a look at results if interested and use Windiff to compare output files as follows:

Windiff.exe &lt;FILE1&gt; &lt;FILE2&gt;&lt;/FILE2&gt;&lt;/FILE1&gt;</description>
      <pubDate>Fri, 28 Jun 2013 01:20:57 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Integrated-Performance/integral-problem/m-p/979764#M21307</guid>
      <dc:creator>SergeyKostrov</dc:creator>
      <dc:date>2013-06-28T01:20:57Z</dc:date>
    </item>
    <item>
      <title>This is again truncation</title>
      <link>https://community.intel.com/t5/Intel-Integrated-Performance/integral-problem/m-p/979765#M21308</link>
      <description>&lt;P&gt;This is again truncation issue. The expression "a/5.0 - (int)(a/5.0)" is performed with different precision for 'float' and 'double' variables. So, the differences can take place.&lt;/P&gt;
&lt;P&gt;Regards,&lt;BR /&gt;Sergey&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 28 Jun 2013 06:16:01 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Integrated-Performance/integral-problem/m-p/979765#M21308</guid>
      <dc:creator>Sergey_K_Intel</dc:creator>
      <dc:date>2013-06-28T06:16:01Z</dc:date>
    </item>
    <item>
      <title>&gt;&gt;...This is again truncation</title>
      <link>https://community.intel.com/t5/Intel-Integrated-Performance/integral-problem/m-p/979766#M21309</link>
      <description>&amp;gt;&amp;gt;...This is again &lt;STRONG&gt;truncation issue&lt;/STRONG&gt;...

Sergey, This is Not a truncation issue and this is a precision issue ( 24-bit precision for 'float' vs. 53-bit precision for 'double' ). I simply wanted to stress on the right usage of that term and I understand that there are limitations with accuracy of floating-point calculations. Thanks.</description>
      <pubDate>Fri, 28 Jun 2013 14:17:07 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Integrated-Performance/integral-problem/m-p/979766#M21309</guid>
      <dc:creator>SergeyKostrov</dc:creator>
      <dc:date>2013-06-28T14:17:07Z</dc:date>
    </item>
  </channel>
</rss>

