<?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 Oh, OK.  Thanks. in Intel® Fortran Compiler</title>
    <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Not-using-FMA/m-p/1113356#M129669</link>
    <description>&lt;P&gt;Oh, OK.&amp;nbsp; Thanks.&lt;/P&gt;

&lt;P&gt;Was the AVX2 instruction set implemented only from generation 5 processors?&lt;/P&gt;

&lt;P&gt;How exactly do I "check to see whether your floating point expressions are evaluated at compile time"?&lt;/P&gt;

&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE&gt;Tim P. wrote:&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;

&lt;P&gt;As your CPU supports AVX, but not AVX2, there is no FMA.&amp;nbsp;&lt;/P&gt;

&lt;P&gt;You might check to see whether your floating point expressions are evaluated at compile time, particularly as it seems the compiler didn't try to generate an AVX2 instruction when so requested.&lt;/P&gt;

&lt;P&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;</description>
    <pubDate>Fri, 26 Aug 2016 20:03:05 GMT</pubDate>
    <dc:creator>rudi-gaelzer</dc:creator>
    <dc:date>2016-08-26T20:03:05Z</dc:date>
    <item>
      <title>Not using FMA?</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Not-using-FMA/m-p/1113354#M129667</link>
      <description>&lt;P&gt;Using:&lt;/P&gt;

&lt;P&gt;Intel(R) Fortran Intel(R) 64 Compiler for applications running on Intel(R) 64, Version 16.0.3.210 Build 20160415&lt;/P&gt;

&lt;P&gt;Processor: Intel(R) Core(TM) i7-4960X&lt;/P&gt;

&lt;P&gt;Fedora Linux 24&lt;/P&gt;

&lt;P&gt;According to Intel's specifications for this processor in:&lt;/P&gt;

&lt;P&gt;&lt;A href="http://ark.intel.com/products/77779/Intel-Core-i7-4960X-Processor-Extreme-Edition-15M-Cache-up-to-4_00-GHz" target="_blank"&gt;http://ark.intel.com/products/77779/Intel-Core-i7-4960X-Processor-Extreme-Edition-15M-Cache-up-to-4_00-GHz&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;it suports &lt;SPAN class="tooltippable"&gt;Instruction Set Extensions&lt;/SPAN&gt; SSE4.2, AVX, AES&lt;/P&gt;

&lt;P&gt;Hence, according to the &lt;EM&gt;Intel® Fortran Compiler 16.0 User and Reference Guide, &lt;/EM&gt;if I compile with "-fma" and "-march=core-avx2" or "-xHost" the compiler should create code with fused multiply-add (FMA) instructions.&lt;/P&gt;

&lt;P&gt;I decided to test if this is the case for me.&amp;nbsp; I've found a simple test program in:&lt;/P&gt;

&lt;P&gt;&lt;A href="https://www.pgroup.com/lit/articles/insider/v3n3a4.htm" target="_blank"&gt;https://www.pgroup.com/lit/articles/insider/v3n3a4.htm&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;which I adapted as&lt;/P&gt;

&lt;PRE class="brush:fortran;"&gt;program testfma3
implicit none
double precision :: a, b, c, d

!a = Z'3c54c9b71a0e6500'       !  4.507E-018
a = z'bF1A28A5F3777D60'
b = Z'bf43a04556d864ae'       ! -5.989E-004
c = Z'bfc55364b6b08299'       ! -0.166

d = 0.0d0
d= a + b*c
write(6,100) "Result: ",d,"(",d,")"

100 format (" ",a15,Z,a1,e22.16,a1)
end program testfma3
&lt;/PRE&gt;

&lt;P&gt;I compiled the code with&lt;/P&gt;

&lt;P&gt;ifort -march=core-avx2 -fma testfma3.f90 -o testfma3x&lt;/P&gt;

&lt;P&gt;and&lt;/P&gt;

&lt;P&gt;ifort -xHost -fma testfma3.f90 -o testfma3x&lt;/P&gt;

&lt;P&gt;In both cases I got the result:&lt;/P&gt;

&lt;P&gt;Result:&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; 0(0.0000000000000000E+00)&lt;/P&gt;

&lt;P&gt;&lt;BR /&gt;
	when, according to the test, I should have obtained&lt;/P&gt;

&lt;PRE&gt;BBBAD89127ADE008(-.5684854190555145E-20)&lt;/PRE&gt;

&lt;P&gt;Does it mean that my processor does not generate FMA instructions after all?&lt;/P&gt;

&lt;P&gt;Thanks.&lt;/P&gt;</description>
      <pubDate>Fri, 26 Aug 2016 19:42:09 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Not-using-FMA/m-p/1113354#M129667</guid>
      <dc:creator>rudi-gaelzer</dc:creator>
      <dc:date>2016-08-26T19:42:09Z</dc:date>
    </item>
    <item>
      <title>As your CPU supports AVX, but</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Not-using-FMA/m-p/1113355#M129668</link>
      <description>&lt;P&gt;As your CPU supports AVX, but not AVX2, there is no FMA.&amp;nbsp;&lt;/P&gt;

&lt;P&gt;You might check to see whether your floating point expressions are evaluated at compile time, particularly as it seems the compiler didn't try to generate an AVX2 instruction when so requested.&lt;/P&gt;

&lt;P&gt;Also, it appears that 0.0 may be the expected result, FMA or not.&lt;/P&gt;</description>
      <pubDate>Fri, 26 Aug 2016 19:53:00 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Not-using-FMA/m-p/1113355#M129668</guid>
      <dc:creator>TimP</dc:creator>
      <dc:date>2016-08-26T19:53:00Z</dc:date>
    </item>
    <item>
      <title>Oh, OK.  Thanks.</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Not-using-FMA/m-p/1113356#M129669</link>
      <description>&lt;P&gt;Oh, OK.&amp;nbsp; Thanks.&lt;/P&gt;

&lt;P&gt;Was the AVX2 instruction set implemented only from generation 5 processors?&lt;/P&gt;

&lt;P&gt;How exactly do I "check to see whether your floating point expressions are evaluated at compile time"?&lt;/P&gt;

&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE&gt;Tim P. wrote:&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;

&lt;P&gt;As your CPU supports AVX, but not AVX2, there is no FMA.&amp;nbsp;&lt;/P&gt;

&lt;P&gt;You might check to see whether your floating point expressions are evaluated at compile time, particularly as it seems the compiler didn't try to generate an AVX2 instruction when so requested.&lt;/P&gt;

&lt;P&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 26 Aug 2016 20:03:05 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Not-using-FMA/m-p/1113356#M129669</guid>
      <dc:creator>rudi-gaelzer</dc:creator>
      <dc:date>2016-08-26T20:03:05Z</dc:date>
    </item>
    <item>
      <title>When I set -S option to</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Not-using-FMA/m-p/1113357#M129670</link>
      <description>&lt;P&gt;When I set -S option to generate asm code, it appears that the result was evaluted at compile time, as there are no floating point instructions.&lt;/P&gt;</description>
      <pubDate>Fri, 26 Aug 2016 20:07:09 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Not-using-FMA/m-p/1113357#M129670</guid>
      <dc:creator>TimP</dc:creator>
      <dc:date>2016-08-26T20:07:09Z</dc:date>
    </item>
    <item>
      <title>Quote:Tim P. wrote:</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Not-using-FMA/m-p/1113358#M129671</link>
      <description>&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE&gt;Tim P. wrote:&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;

&lt;P&gt;Also, it appears that 0.0 may be the expected result, FMA or not.&lt;/P&gt;

&lt;P&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;

&lt;P&gt;Not according to the text I cited.&amp;nbsp; But I cannot verify, as I don't have access to FMA...&lt;/P&gt;</description>
      <pubDate>Fri, 26 Aug 2016 20:32:31 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Not-using-FMA/m-p/1113358#M129671</guid>
      <dc:creator>rudi-gaelzer</dc:creator>
      <dc:date>2016-08-26T20:32:31Z</dc:date>
    </item>
    <item>
      <title>The paper you referred to</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Not-using-FMA/m-p/1113359#M129672</link>
      <description>&lt;P&gt;The paper you referred to quoted 0.0 as the expected result without FMA, with rounding mode set to "up."&amp;nbsp; As you didn't set rounding mode, it is required to default to "nearest."&amp;nbsp; I don't know whether there any set requirements on rounding mode and precision for compile-time evaluation.&lt;/P&gt;</description>
      <pubDate>Fri, 26 Aug 2016 23:07:09 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Not-using-FMA/m-p/1113359#M129672</guid>
      <dc:creator>TimP</dc:creator>
      <dc:date>2016-08-26T23:07:09Z</dc:date>
    </item>
  </channel>
</rss>

