<?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 Thanks! So, the comment &amp;quot;not in Software Archive</title>
    <link>https://community.intel.com/t5/Software-Archive/Understanding-a-vectorization-report-with-contradicting-lines/m-p/979535#M25733</link>
    <description>&lt;P&gt;Thanks! So, the comment "not inner loop" with respect to inner loops can be ignored.&lt;/P&gt;</description>
    <pubDate>Tue, 26 Mar 2013 02:34:30 GMT</pubDate>
    <dc:creator>Andrey_Vladimirov</dc:creator>
    <dc:date>2013-03-26T02:34:30Z</dc:date>
    <item>
      <title>Understanding a vectorization report with contradicting lines</title>
      <link>https://community.intel.com/t5/Software-Archive/Understanding-a-vectorization-report-with-contradicting-lines/m-p/979531#M25729</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;I am trying to understand the inner monologue of the Intel compiler when it compiles a loop with assumed vector dependence:&lt;/P&gt;
&lt;P&gt;[cpp]&lt;/P&gt;
&lt;P&gt;void SomeFunction(const int n, int *a, int *b) &lt;BR /&gt;{ &lt;BR /&gt;#pragma ivdep&lt;BR /&gt; for (int i = 0; i &amp;lt; n; i++) &lt;BR /&gt; a&lt;I&gt; = b&lt;I&gt;;&lt;BR /&gt;}&lt;/I&gt;&lt;/I&gt;&lt;/P&gt;
&lt;P&gt;[/cpp]&lt;/P&gt;
&lt;P&gt;Here is the result:&lt;/P&gt;
&lt;P&gt;[bash]&lt;/P&gt;
&lt;P&gt;[avladim@dublin ~]$ icpc -c -vec-report3 ivdep.cc&lt;BR /&gt;ivdep.cc(4): (col. 3) remark: LOOP WAS VECTORIZED.&lt;BR /&gt;ivdep.cc(4): (col. 3) remark: loop was not vectorized: not inner loop.&lt;BR /&gt;[avladim@dublin ~]$&lt;/P&gt;
&lt;P&gt;[/bash]&lt;/P&gt;
&lt;P&gt;The problem here is that the first line of the output contradicts the second line.&lt;/P&gt;
&lt;P&gt;This is a trivial example, and I know that in this case, the loop is vectorized, because if I do something funny like "SomeFunction(100, a+1, a)", the application will crash. But for more complex applications, I would like to know: when I see messages like this, should I trust the last line or the line in capital letters, or is there some other output that I can look at?&lt;/P&gt;
&lt;P&gt;Thanks!&lt;/P&gt;
&lt;P&gt;Andrey&lt;/P&gt;</description>
      <pubDate>Sun, 24 Mar 2013 22:11:44 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/Understanding-a-vectorization-report-with-contradicting-lines/m-p/979531#M25729</guid>
      <dc:creator>Andrey_Vladimirov</dc:creator>
      <dc:date>2013-03-24T22:11:44Z</dc:date>
    </item>
    <item>
      <title>Often, such messages are an</title>
      <link>https://community.intel.com/t5/Software-Archive/Understanding-a-vectorization-report-with-contradicting-lines/m-p/979532#M25730</link>
      <description>&lt;P&gt;Often, such messages are an indication the compiler has generated multiple versions, with selection to be made at run time.&amp;nbsp; This one is a surprise, particularly since it doesn't appear to be checking for your bad case.&amp;nbsp; I'd be curious if the same thing happens when vectorization is promoted by * restrict.&lt;/P&gt;</description>
      <pubDate>Mon, 25 Mar 2013 21:19:14 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/Understanding-a-vectorization-report-with-contradicting-lines/m-p/979532#M25730</guid>
      <dc:creator>TimP</dc:creator>
      <dc:date>2013-03-25T21:19:14Z</dc:date>
    </item>
    <item>
      <title>The same message and the same</title>
      <link>https://community.intel.com/t5/Software-Archive/Understanding-a-vectorization-report-with-contradicting-lines/m-p/979533#M25731</link>
      <description>&lt;P&gt;The same message and the same result with the keyword restrict. And I made a test run to confirm that vectorization does occur (see below). Probing the fool-proofness of the compiler may not be the most useful thing to do, but I just want to better understand the diagnostic messages. Thank you for the insight!&lt;/P&gt;
&lt;P&gt;[cpp]&lt;/P&gt;
&lt;P&gt;1 #include &amp;lt;cstdio&amp;gt;&lt;BR /&gt; 2 &lt;BR /&gt; 3 const int N = 100;&lt;BR /&gt; 4 int A&lt;N&gt;;&lt;BR /&gt; 5 &lt;BR /&gt; 6 void MyCopyScalar(int n, int* a, int* b) { &lt;BR /&gt; 7 for (int i = 0; i &amp;lt; N; i++)&lt;BR /&gt; 8 a&lt;I&gt; = b&lt;I&gt;; &lt;BR /&gt; 9 }&lt;BR /&gt; 10 &lt;BR /&gt; 11 void MyCopyIvdep(int n, int* a, int* b) { &lt;BR /&gt; 12 #pragma ivdep&lt;BR /&gt; 13 for (int i = 0; i &amp;lt; N; i++)&lt;BR /&gt; 14 a&lt;I&gt; = b&lt;I&gt;; &lt;BR /&gt; 15 }&lt;BR /&gt; 16 &lt;BR /&gt; 17 void MyCopyRestrict(int n, int* restrict a, int* restrict b) { &lt;BR /&gt; 18 for (int i = 0; i &amp;lt; N; i++)&lt;BR /&gt; 19 a&lt;I&gt; = b&lt;I&gt;; &lt;BR /&gt; 20 }&lt;BR /&gt; 21 &lt;BR /&gt; 22 void Init() { &lt;BR /&gt; 23 for (int i = 0; i &amp;lt; N; i++) &lt;BR /&gt; 24 A&lt;I&gt; = i; &lt;BR /&gt; 25 }&lt;BR /&gt; 26 &lt;BR /&gt; 27 void Output(const char* msg) {&lt;BR /&gt; 28 printf("%s:\n", msg);&lt;BR /&gt; 29 for (int i = 0; i &amp;lt; 12; i++) &lt;BR /&gt; 30 printf("%4d", A&lt;I&gt;); printf("...\n\n");&lt;BR /&gt; 31 }&lt;BR /&gt; 32 &lt;BR /&gt; 33 int main() {&lt;BR /&gt; 34 &lt;BR /&gt; 35 Init();&lt;BR /&gt; 36 Output("Original array");&lt;BR /&gt; 37 &lt;BR /&gt; 38 Init(); &lt;BR /&gt; 39 MyCopyScalar(N-1, &amp;amp;A[1], &amp;amp;A[0]);&lt;BR /&gt; 40 Output("After MyCopyScalar (correct result)");&lt;BR /&gt; 41 &lt;BR /&gt; 42 Init(); &lt;BR /&gt; 43 MyCopyIvdep(N-1, &amp;amp;A[1], &amp;amp;A[0]);&lt;BR /&gt; 44 Output("After MyCopyIvdep");&lt;BR /&gt; 45 &lt;BR /&gt; 46 Init(); &lt;BR /&gt; 47 MyCopyRestrict(N-1, &amp;amp;A[1], &amp;amp;A[0]);&lt;BR /&gt; 48 Output("After MyCopyRestrict");&lt;BR /&gt; 49 &lt;BR /&gt; 50 }&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/N&gt;&lt;/P&gt;
&lt;P&gt;[/cpp]&lt;/P&gt;
&lt;P&gt;[bash]&lt;/P&gt;
&lt;P&gt;[avladim@dublin ~]$ icpc -c vectorcopy.cc -restrict -vec-report3&lt;/P&gt;
&lt;P&gt;vectorcopy.cc(35): (col. 3) remark: LOOP WAS VECTORIZED.&lt;BR /&gt;vectorcopy.cc(36): (col. 3) remark: loop was not vectorized: existence of vector dependence.&lt;BR /&gt;vectorcopy.cc(38): (col. 3) remark: LOOP WAS VECTORIZED.&lt;BR /&gt;vectorcopy.cc(39): (col. 3) remark: loop skipped: multiversioned.&lt;BR /&gt;vectorcopy.cc(39): (col. 3) remark: loop was not vectorized: not inner loop.&lt;BR /&gt;vectorcopy.cc(40): (col. 3) remark: loop was not vectorized: existence of vector dependence.&lt;BR /&gt;vectorcopy.cc(42): (col. 3) remark: LOOP WAS VECTORIZED.&lt;BR /&gt;vectorcopy.cc(43): (col. 3) remark: LOOP WAS VECTORIZED.&lt;BR /&gt;vectorcopy.cc(43): (col. 3) remark: loop was not vectorized: not inner loop.&lt;BR /&gt;vectorcopy.cc(44): (col. 3) remark: loop was not vectorized: existence of vector dependence.&lt;BR /&gt;vectorcopy.cc(46): (col. 3) remark: LOOP WAS VECTORIZED.&lt;BR /&gt;vectorcopy.cc(47): (col. 3) remark: LOOP WAS VECTORIZED.&lt;BR /&gt;vectorcopy.cc(47): (col. 3) remark: loop was not vectorized: not inner loop.&lt;BR /&gt;vectorcopy.cc(48): (col. 3) remark: loop was not vectorized: existence of vector dependence.&lt;BR /&gt;vectorcopy.cc(7): (col. 3) remark: loop skipped: multiversioned.&lt;BR /&gt;vectorcopy.cc(7): (col. 3) remark: loop was not vectorized: not inner loop.&lt;BR /&gt;vectorcopy.cc(13): (col. 3) remark: loop was not vectorized: loop was transformed to memset or memcpy.&lt;BR /&gt;vectorcopy.cc(18): (col. 3) remark: loop was not vectorized: loop was transformed to memset or memcpy.&lt;BR /&gt;vectorcopy.cc(29): (col. 3) remark: loop was not vectorized: existence of vector dependence.&lt;BR /&gt;vectorcopy.cc(23): (col. 3) remark: LOOP WAS VECTORIZED.&lt;BR /&gt;[avladim@dublin ~]$ ./a.out&amp;nbsp;&lt;BR /&gt;Original array:&lt;BR /&gt;0 1 2 3 4 5 6 7 8 9 10 11...&lt;/P&gt;
&lt;P&gt;After MyCopyScalar (correct result):&lt;BR /&gt;0 0 0 0 0 0 0 0 0 0 0 0...&lt;/P&gt;
&lt;P&gt;After MyCopyIvdep:&lt;BR /&gt;0 0 0 0 0 4 5 6 6 8 9 10...&lt;/P&gt;
&lt;P&gt;After MyCopyRestrict:&lt;BR /&gt;0 0 0 0 0 4 5 6 6 8 9 10...&lt;/P&gt;
&lt;P&gt;[avladim@dublin ~]$&lt;/P&gt;
&lt;P&gt;[/bash]&lt;/P&gt;</description>
      <pubDate>Mon, 25 Mar 2013 22:24:00 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/Understanding-a-vectorization-report-with-contradicting-lines/m-p/979533#M25731</guid>
      <dc:creator>Andrey_Vladimirov</dc:creator>
      <dc:date>2013-03-25T22:24:00Z</dc:date>
    </item>
    <item>
      <title>ivdep.cc(4): (col. 3) remark:</title>
      <link>https://community.intel.com/t5/Software-Archive/Understanding-a-vectorization-report-with-contradicting-lines/m-p/979534#M25732</link>
      <description>&lt;P&gt;ivdep.cc(4): (col. 3) remark: LOOP WAS VECTORIZED.&lt;BR /&gt;ivdep.cc(4): (col. 3) remark: loop was not vectorized: not inner loop.&lt;/P&gt;
&lt;P&gt;This is an artifact of how the compiler vectorizes the loop.&amp;nbsp; It creates an outer loop with only one interation and inside this generates alternate code based on the total iterations of the original loop to either use memcpy or a vector loop&lt;/P&gt;
&lt;P&gt;So you will have&lt;/P&gt;
&lt;P&gt;for (temp=0; temp&amp;lt;1; temp++) {&lt;BR /&gt;&amp;nbsp; if (i &amp;lt; X)&amp;nbsp; &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; memcpy(....)&lt;BR /&gt;&amp;nbsp; else &lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; vector form of for(int i=0; i&amp;lt;n; i++) .....&lt;/P&gt;
&lt;P&gt;The message "remark: loop was not vectorized: not inner loop."&amp;nbsp; is for the outer dummy loop the compiler has generated and the message "remark: LOOP WAS VECTORIZED" for the actual user loop which is vectorized.&lt;/P&gt;</description>
      <pubDate>Mon, 25 Mar 2013 23:54:58 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/Understanding-a-vectorization-report-with-contradicting-lines/m-p/979534#M25732</guid>
      <dc:creator>Ravi_N_Intel</dc:creator>
      <dc:date>2013-03-25T23:54:58Z</dc:date>
    </item>
    <item>
      <title>Thanks! So, the comment "not</title>
      <link>https://community.intel.com/t5/Software-Archive/Understanding-a-vectorization-report-with-contradicting-lines/m-p/979535#M25733</link>
      <description>&lt;P&gt;Thanks! So, the comment "not inner loop" with respect to inner loops can be ignored.&lt;/P&gt;</description>
      <pubDate>Tue, 26 Mar 2013 02:34:30 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/Understanding-a-vectorization-report-with-contradicting-lines/m-p/979535#M25733</guid>
      <dc:creator>Andrey_Vladimirov</dc:creator>
      <dc:date>2013-03-26T02:34:30Z</dc:date>
    </item>
  </channel>
</rss>

