<?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 Are you saying you don't want in Software Archive</title>
    <link>https://community.intel.com/t5/Software-Archive/Problem-with-Scatter-Gather-operations/m-p/1011396#M34294</link>
    <description>&lt;P&gt;Are you saying you don't want to vectorize the C (e.g. with directives or CEAN)? &amp;nbsp;Doing so would give you something to compare against.&lt;/P&gt;</description>
    <pubDate>Sun, 11 May 2014 17:02:21 GMT</pubDate>
    <dc:creator>TimP</dc:creator>
    <dc:date>2014-05-11T17:02:21Z</dc:date>
    <item>
      <title>Problem with Scatter/Gather operations</title>
      <link>https://community.intel.com/t5/Software-Archive/Problem-with-Scatter-Gather-operations/m-p/1011394#M34292</link>
      <description>&lt;P&gt;Hi, i am vectorizing some code using the MIC intrinsics. But i am getting segmentation fault on MIC (offload error: process on the device 0 was terminated by signal 11 (SIGSEGV) ).&amp;nbsp;Some one please tell me where am i doing mistake. It seems like a simple error. but i am stuck here.&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;Normal code:&lt;/STRONG&gt;&lt;/P&gt;

&lt;P&gt;for(curIdx = 0; curIdx &amp;lt; index; curIdx++)&lt;BR /&gt;
	&amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;{&lt;BR /&gt;
	&amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;outreal[cidxarray[curIdx]] += inrealvalue*valuearray[curIdx];&lt;BR /&gt;
	&amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;}&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;Vectorized code:&lt;/STRONG&gt;&lt;/P&gt;

&lt;P&gt;int remain = index %16;&lt;BR /&gt;
	int indexSize = index-remain;&lt;BR /&gt;
	v1 = _mm512_set1_ps(inrealvalue);&lt;BR /&gt;
	&amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/P&gt;

&lt;P&gt;&lt;SPAN style="font-size: 1em; line-height: 1.5;"&gt;for(int curIdx = 0; curIdx &amp;lt; indexSize; curIdx = curIdx+16)&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;&lt;SPAN style="font-size: 1em; line-height: 1.5;"&gt;&amp;nbsp;{&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp;v1i = _mm512_load_epi32(cidxarray+curIdx);&lt;BR /&gt;
	&amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp;v2 = _mm512_load_ps((void*)(valuearray+curIdx));&lt;BR /&gt;
	&amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;BR /&gt;
	&amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp;v3 = _mm512_mul_ps(v1,v2); &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; // doing inrealvalue*valuearray[curIdx];&lt;BR /&gt;
	&amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp;v4 = _mm512_i32gather_ps(v1i,(void*)outreal,sizeof(float)); &amp;nbsp; &amp;nbsp; &amp;nbsp;// access values from outreal and store in v4;&lt;BR /&gt;
	&amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp;v5 = _mm512_add_ps(v3,v4); &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;// doing&amp;nbsp;outreal[cidxarray[curIdx]] += inrealvalue*valuearray[curIdx] and stores in v5&lt;BR /&gt;
	&amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp;_mm512_i32scatter_ps((void*)outreal,v1i,v5,sizeof(float)); &amp;nbsp; &amp;nbsp; // storing it back into outreal array&lt;/P&gt;

&lt;P&gt;}&lt;BR /&gt;
	&amp;nbsp; &amp;nbsp;&amp;nbsp;for(curIdx = indexSize; curIdx &amp;lt; index; curIdx++)&lt;BR /&gt;
	&amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;{&lt;BR /&gt;
	&amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;outreal[cidxarray[curIdx]] += inrealvalue*valuearray[curIdx];&lt;BR /&gt;
	&amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;}&lt;SPAN style="font-size: 1em; line-height: 1.5;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;&lt;SPAN style="font-size: 1em; line-height: 1.5;"&gt;Thanks&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;&lt;SPAN style="font-size: 1em; line-height: 1.5;"&gt;sivaramakrishna&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 10 May 2014 11:08:49 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/Problem-with-Scatter-Gather-operations/m-p/1011394#M34292</guid>
      <dc:creator>shiva_rama_krishna_b</dc:creator>
      <dc:date>2014-05-10T11:08:49Z</dc:date>
    </item>
    <item>
      <title>Hard to tell. Insert some</title>
      <link>https://community.intel.com/t5/Software-Archive/Problem-with-Scatter-Gather-operations/m-p/1011395#M34293</link>
      <description>&lt;P&gt;Hard to tell. Insert some ASSERTs to assert that the arrays are cache line aligned.&lt;/P&gt;

&lt;P&gt;If this doesn't expose something then insert some trace code to see at which point it fails (though this may alter the behavior).&lt;/P&gt;

&lt;P&gt;Jim Dempsey&lt;/P&gt;</description>
      <pubDate>Sat, 10 May 2014 12:23:28 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/Problem-with-Scatter-Gather-operations/m-p/1011395#M34293</guid>
      <dc:creator>jimdempseyatthecove</dc:creator>
      <dc:date>2014-05-10T12:23:28Z</dc:date>
    </item>
    <item>
      <title>Are you saying you don't want</title>
      <link>https://community.intel.com/t5/Software-Archive/Problem-with-Scatter-Gather-operations/m-p/1011396#M34294</link>
      <description>&lt;P&gt;Are you saying you don't want to vectorize the C (e.g. with directives or CEAN)? &amp;nbsp;Doing so would give you something to compare against.&lt;/P&gt;</description>
      <pubDate>Sun, 11 May 2014 17:02:21 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/Problem-with-Scatter-Gather-operations/m-p/1011396#M34294</guid>
      <dc:creator>TimP</dc:creator>
      <dc:date>2014-05-11T17:02:21Z</dc:date>
    </item>
  </channel>
</rss>

