<?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 Example solution attached. in Intel® Integrated Performance Primitives</title>
    <link>https://community.intel.com/t5/Intel-Integrated-Performance/ippsMaxIndx-32f-bug-with-INFINITY/m-p/1138010#M26008</link>
    <description>&lt;P&gt;Example solution attached.&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 05 Jul 2017 01:18:07 GMT</pubDate>
    <dc:creator>Rodney_T_</dc:creator>
    <dc:date>2017-07-05T01:18:07Z</dc:date>
    <item>
      <title>ippsMaxIndx_32f bug with -INFINITY</title>
      <link>https://community.intel.com/t5/Intel-Integrated-Performance/ippsMaxIndx-32f-bug-with-INFINITY/m-p/1138007#M26005</link>
      <description>&lt;P&gt;&lt;STRONG&gt;Bug: &lt;/STRONG&gt;&lt;BR /&gt;
	Calling ippsMaxIndx_32f on array containing values initialised to -Infinity will sometimes fail.&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;Detail:&lt;/STRONG&gt;&lt;BR /&gt;
	Calling ippsMaxIndx_32f on an array containing values initialised to -Infinity (00 00 80 ff), will set pIndx to len, for length values &amp;gt;33 and where (len % 8) != 0. In these cases the returned IppStatus is set to ippStsNoErr. Attempting to use the returned index on the original array results in seg fault / out of range exception.&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;Environment:&lt;/STRONG&gt;&lt;/P&gt;

&lt;UL&gt;
	&lt;LI&gt;IPP Version 9.0.3&lt;/LI&gt;
	&lt;LI&gt;Visual Studio 2015&lt;/LI&gt;
	&lt;LI&gt;x64 Debug build&lt;/LI&gt;
	&lt;LI&gt;Windows 7 64-bit&lt;/LI&gt;
	&lt;LI&gt;Intel Core i7-2600&lt;/LI&gt;
&lt;/UL&gt;

&lt;P&gt;&lt;STRONG&gt;To reproduce:&lt;/STRONG&gt;&lt;/P&gt;

&lt;PRE class="brush:cpp;"&gt;#include "stdafx.h"
#include &amp;lt;ipp.h&amp;gt;
#include &amp;lt;limits&amp;gt;
#include &amp;lt;iostream&amp;gt;
#include &amp;lt;assert.h&amp;gt;

bool testMaxIndx_32f(int length, float value)
{
	Ipp32f  max = 0.0f;
	int     maxIdx = 0;
	Ipp32f* tmpArray;

	tmpArray = ippsMalloc_32f(length);
	
	for (int i = 0; i &amp;lt; length; ++i)
		tmpArray&lt;I&gt; = value;

	IppStatus status = ippsMaxIndx_32f(tmpArray, length, &amp;amp;max, &amp;amp;maxIdx);
	assert(status == ippStsNoErr);
	
	ippsFree(tmpArray);
	
	return (maxIdx != length);
}

int main()
{
	// Test using IPP alloc
	for (int len = 1; len &amp;lt; 100; ++len)
	{
		if (!testMaxIndx_32f(len, -INFINITY))
			std::cout &amp;lt;&amp;lt; "ippsMaxIndx error for -INFINITY and length " &amp;lt;&amp;lt; len &amp;lt;&amp;lt; " (Ipp Alloc)" &amp;lt;&amp;lt; std::endl;
	}
}&lt;/I&gt;&lt;/PRE&gt;

&lt;P&gt;&lt;STRONG&gt;Output (trimmed):&lt;/STRONG&gt;&lt;/P&gt;

&lt;P&gt;ippsMaxIndx error for -INFINITY and length 34 (Ipp Alloc)&lt;BR /&gt;
	ippsMaxIndx error for -INFINITY and length 35 (Ipp Alloc)&lt;BR /&gt;
	ippsMaxIndx error for -INFINITY and length 36 (Ipp Alloc)&lt;BR /&gt;
	ippsMaxIndx error for -INFINITY and length 37 (Ipp Alloc)&lt;BR /&gt;
	ippsMaxIndx error for -INFINITY and length 38 (Ipp Alloc)&lt;BR /&gt;
	ippsMaxIndx error for -INFINITY and length 39 (Ipp Alloc)&lt;BR /&gt;
	ippsMaxIndx error for -INFINITY and length 41 (Ipp Alloc)&lt;BR /&gt;
	ippsMaxIndx error for -INFINITY and length 42 (Ipp Alloc)&lt;BR /&gt;
	ippsMaxIndx error for -INFINITY and length 43 (Ipp Alloc)&lt;BR /&gt;
	ippsMaxIndx error for -INFINITY and length 44 (Ipp Alloc)&lt;BR /&gt;
	ippsMaxIndx error for -INFINITY and length 45 (Ipp Alloc)&lt;BR /&gt;
	ippsMaxIndx error for -INFINITY and length 46 (Ipp Alloc)&lt;BR /&gt;
	ippsMaxIndx error for -INFINITY and length 47 (Ipp Alloc)&lt;BR /&gt;
	ippsMaxIndx error for -INFINITY and length 49 (Ipp Alloc)&lt;BR /&gt;
	ippsMaxIndx error for -INFINITY and length 50 (Ipp Alloc)&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;Notes:&lt;/STRONG&gt;&lt;BR /&gt;
	The corresponding error exists with ippsMinIndx_32f and positive INFINITY. I have not tested if the same issue occurs with other datatypes (64f/16s/32s).&lt;BR /&gt;
	&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 30 Jun 2017 07:32:23 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Integrated-Performance/ippsMaxIndx-32f-bug-with-INFINITY/m-p/1138007#M26005</guid>
      <dc:creator>Rodney_T_</dc:creator>
      <dc:date>2017-06-30T07:32:23Z</dc:date>
    </item>
    <item>
      <title>Hi Rodney,</title>
      <link>https://community.intel.com/t5/Intel-Integrated-Performance/ippsMaxIndx-32f-bug-with-INFINITY/m-p/1138008#M26006</link>
      <description>&lt;P&gt;Hi Rodney,&lt;/P&gt;

&lt;P&gt;I could not reproduce your problem in IPP 9.0.3 &amp;amp; VS 2015. On the other hand, the name for variables/const probably could not start from minus sign, only underline and letter. The "INFINITY" is defined in cmath lib, but probably do not have "-INFINITY", I feel confused with the value you described &lt;SPAN style="font-size: 12px;"&gt;&amp;nbsp;-Infinity (00 00 80 ff)&lt;/SPAN&gt;. Largest value of 32bits float is 3.402823 × 10&lt;SUP&gt;38&lt;/SUP&gt;&amp;nbsp;, and inf should be bigger than max value, but do not have a specified value.&lt;/P&gt;

&lt;P&gt;Best regards,&lt;BR /&gt;
	Fiona&lt;/P&gt;</description>
      <pubDate>Tue, 04 Jul 2017 04:16:45 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Integrated-Performance/ippsMaxIndx-32f-bug-with-INFINITY/m-p/1138008#M26006</guid>
      <dc:creator>Zhen_Z_Intel</dc:creator>
      <dc:date>2017-07-04T04:16:45Z</dc:date>
    </item>
    <item>
      <title>Hi Fiona,</title>
      <link>https://community.intel.com/t5/Intel-Integrated-Performance/ippsMaxIndx-32f-bug-with-INFINITY/m-p/1138009#M26007</link>
      <description>&lt;P style="color: rgb(34, 34, 34); font-family: arial, sans-serif; font-size: 12.8px;"&gt;Hi Fiona,&lt;/P&gt;

&lt;P style="color: rgb(34, 34, 34); font-family: arial, sans-serif; font-size: 12.8px;"&gt;(00 00 80 FF) is the representation of negative infinity as per IEEE-754 (&lt;A data-saferedirecturl="https://www.google.com/url?hl=en-GB&amp;amp;q=https://en.wikipedia.org/wiki/IEEE_754-1985%23Positive_and_negative_infinity&amp;amp;source=gmail&amp;amp;ust=1499263416327000&amp;amp;usg=AFQjCNEM-DKQ5PzFAWfmNsucaGnYtem2iA" href="https://en.wikipedia.org/wiki/IEEE_754-1985#Positive_and_negative_infinity" style="color: rgb(17, 85, 204);" target="_blank"&gt;&lt;/A&gt;&lt;A href="https://en.wikipedia.org/" target="_blank"&gt;https://en.wikipedia.org/&lt;/A&gt;&lt;WBR /&gt;wiki/IEEE_754-1985#Positive_&lt;WBR /&gt;and_negative_infinity). INFINITY is defined in cmath, and -INFINITY is the same as -1.0f*INFINITY, ie it just changes the sign bit of the floating point number.&lt;/P&gt;

&lt;P style="color: rgb(34, 34, 34); font-family: arial, sans-serif; font-size: 12.8px;"&gt;I'm confused by your response, were you unable to compile my example? Or did your application not fail the test?&lt;/P&gt;

&lt;P style="color: rgb(34, 34, 34); font-family: arial, sans-serif; font-size: 12.8px;"&gt;If you have an email address I can send you a VS2015 solution.&amp;nbsp;&lt;/P&gt;

&lt;P style="color: rgb(34, 34, 34); font-family: arial, sans-serif; font-size: 12.8px;"&gt;Cheers, Rodney&lt;/P&gt;</description>
      <pubDate>Tue, 04 Jul 2017 14:02:00 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Integrated-Performance/ippsMaxIndx-32f-bug-with-INFINITY/m-p/1138009#M26007</guid>
      <dc:creator>Rodney_T_</dc:creator>
      <dc:date>2017-07-04T14:02:00Z</dc:date>
    </item>
    <item>
      <title>Example solution attached.</title>
      <link>https://community.intel.com/t5/Intel-Integrated-Performance/ippsMaxIndx-32f-bug-with-INFINITY/m-p/1138010#M26008</link>
      <description>&lt;P&gt;Example solution attached.&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 05 Jul 2017 01:18:07 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Integrated-Performance/ippsMaxIndx-32f-bug-with-INFINITY/m-p/1138010#M26008</guid>
      <dc:creator>Rodney_T_</dc:creator>
      <dc:date>2017-07-05T01:18:07Z</dc:date>
    </item>
    <item>
      <title>For array lengths 1 through</title>
      <link>https://community.intel.com/t5/Intel-Integrated-Performance/ippsMaxIndx-32f-bug-with-INFINITY/m-p/1138011#M26009</link>
      <description>&lt;P&gt;For array lengths 1 through 33 it behaves as I expected from the documentation:&lt;BR /&gt;
	- pMax contains the value '-inf' (00 0 80 FF)&lt;BR /&gt;
	- pIndx contains the value 0, ie the first index from the beginning with equal maximum element&lt;/P&gt;

&lt;P&gt;However when the array length reaches 34, and beyond:&lt;BR /&gt;
	- pMax contains the value '-3.40282347e+38' (max float value that is NOT infinity)&lt;BR /&gt;
	- pIndx contains the value 34, ie an out of bounds index (although in some instances it returns an index of 4).&lt;BR /&gt;
	- The returned status is ippStsNoErr&lt;/P&gt;

&lt;P&gt;When it reaches array length of 40, and multiples of 8, it again behaves as I expect:&lt;/P&gt;

&lt;P&gt;- pMax contains the value '-inf' (00 0 80 FF)&lt;BR /&gt;
	- pIndx contains the value 0, ie the first index from the beginning with equal maximum element&lt;/P&gt;</description>
      <pubDate>Wed, 05 Jul 2017 03:28:54 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Integrated-Performance/ippsMaxIndx-32f-bug-with-INFINITY/m-p/1138011#M26009</guid>
      <dc:creator>Rodney_T_</dc:creator>
      <dc:date>2017-07-05T03:28:54Z</dc:date>
    </item>
    <item>
      <title>Hi all,</title>
      <link>https://community.intel.com/t5/Intel-Integrated-Performance/ippsMaxIndx-32f-bug-with-INFINITY/m-p/1138012#M26010</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;

&lt;P&gt;There&amp;nbsp;are the bugs in functions ipps{Min|Max}Indx_{32f|64f}. The functions&amp;nbsp;run incorrectly if all elements of source vector equal Inf (-Inf) and vector length is more 34. For types 16s, 32 these functions run correctly.&lt;/P&gt;

&lt;P&gt;This bug will be fixed in the next versions.&lt;/P&gt;

&lt;P&gt;Thank you very much for the example of incorrect work of these functions.&lt;/P&gt;</description>
      <pubDate>Wed, 05 Jul 2017 17:03:48 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Integrated-Performance/ippsMaxIndx-32f-bug-with-INFINITY/m-p/1138012#M26010</guid>
      <dc:creator>Ivan_Z_Intel</dc:creator>
      <dc:date>2017-07-05T17:03:48Z</dc:date>
    </item>
    <item>
      <title>Hi Ivan, thanks for your</title>
      <link>https://community.intel.com/t5/Intel-Integrated-Performance/ippsMaxIndx-32f-bug-with-INFINITY/m-p/1138013#M26011</link>
      <description>&lt;P&gt;Hi Ivan, thanks for your response. I look forward to the fix in the next release.&lt;/P&gt;</description>
      <pubDate>Thu, 06 Jul 2017 00:47:00 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Integrated-Performance/ippsMaxIndx-32f-bug-with-INFINITY/m-p/1138013#M26011</guid>
      <dc:creator>Rodney_T_</dc:creator>
      <dc:date>2017-07-06T00:47:00Z</dc:date>
    </item>
  </channel>
</rss>

