<?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 Thank you Jim. That does work in Intel® Fortran Compiler</title>
    <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Using-omp-declare-simd-in-an-elemental-subroutine/m-p/1013610#M106573</link>
    <description>&lt;P&gt;Thank you Jim. That does work, but it's not standard Fortran 2003 any more. That seems like a step backward.&lt;/P&gt;

&lt;P&gt;So, either:&lt;/P&gt;

&lt;P&gt;- &amp;nbsp; this is genuinely non-conforming code, and the Intel compiler is wrong to allow it with a non-standard directive (not to mention the Intel documentation being wrong to recommend it).&lt;/P&gt;

&lt;P&gt;or&lt;/P&gt;

&lt;P&gt;- &amp;nbsp;this is in fact standard-conforming code and the fact that the new Fortran compiler won't compile it, when the old Fortran compiler did, is a new regression bug in the 16.0 compiler.&lt;/P&gt;

&lt;P&gt;I think I need to wait for someone from Intel to reply, hopefully on Monday.&lt;/P&gt;</description>
    <pubDate>Sat, 05 Sep 2015 09:50:33 GMT</pubDate>
    <dc:creator>eos_pengwern</dc:creator>
    <dc:date>2015-09-05T09:50:33Z</dc:date>
    <item>
      <title>Using !$omp declare simd in an elemental subroutine</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Using-omp-declare-simd-in-an-elemental-subroutine/m-p/1013608#M106571</link>
      <description>&lt;P&gt;Quite recently (in May), I decided to update some of my codebase to use OpenMP 4.0 and, in particular, try out the "!$omp declare simd"&amp;nbsp;&lt;SPAN style="line-height: 1.5; font-size: 1em;"&gt;directive. After a few teething troubles documented in a question I asked &lt;/SPAN&gt;&lt;A style="line-height: 1.5; font-size: 1em;" href="https://software.intel.com/en-us/forums/topic/558125"&gt;here&lt;/A&gt;&lt;SPAN style="line-height: 1.5; font-size: 1em;"&gt;, I got it working well and it has been running smoothly ever since. As it's such a short subroutine, I'll reproduce it here for convenience:&lt;/SPAN&gt;&lt;/P&gt;

&lt;PRE class="brush:fortran;"&gt;elemental subroutine Calculate_Sines(normal_x, normal_y, normal_z, &amp;amp;
                                     rzero_x, rzero_y, rzero_z,    &amp;amp;
                                     es_x, es_y, es_z, sin_theta)
 
!$omp declare simd(Calculate_Sines) uniform(normal_x, normal_y, normal_z)
    real(kind(1d0)), intent(in) :: normal_x, normal_y, normal_z
    real(kind(1d0)), intent(in) :: rzero_x, rzero_y, rzero_z
    real(kind(1d0)), intent(out) :: es_x, es_y, es_z, sin_theta
       
    es_x = normal_z * rzero_y - normal_y * rzero_z
    es_y = normal_x * rzero_z - normal_z * rzero_x
    es_z = normal_y * rzero_x - normal_x * rzero_y       
     
    sin_theta = sqrt( es_x**2 + es_y**2 + es_z**2 )
 
end subroutine Calculate_Sines
&lt;/PRE&gt;

&lt;P&gt;However, I've just installed Parallel Studio XE 16.0 and everything has come to a juddering halt. The same piece of code now fails to compile, with the error message:&lt;/P&gt;

&lt;PRE class="brush:bash;"&gt;error #8807: An OpenMP* directive may not appear in a PURE procedure.&lt;/PRE&gt;

&lt;P&gt;I assume that an elemental subroutine is pure by implication. My basic syntax isn't at all original, as it very closely follows an example given in the Intel documentation &lt;A href="https://software.intel.com/en-us/articles/explicit-vector-programming-in-fortran"&gt;here&lt;/A&gt;, so I can't really figure out what I should do. Is the example in the documentation, which dates from May 2014 no longer valid? Or am I just doing something really dumb?&lt;/P&gt;</description>
      <pubDate>Fri, 04 Sep 2015 23:31:24 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Using-omp-declare-simd-in-an-elemental-subroutine/m-p/1013608#M106571</guid>
      <dc:creator>eos_pengwern</dc:creator>
      <dc:date>2015-09-04T23:31:24Z</dc:date>
    </item>
    <item>
      <title>Look in the documentation</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Using-omp-declare-simd-in-an-elemental-subroutine/m-p/1013609#M106572</link>
      <description>&lt;P&gt;Look in the documentation under VECTOR | ATTRIBUTES VECTOR&lt;/P&gt;

&lt;P&gt;Consider using&lt;/P&gt;

&lt;P&gt;!DIR$ ATTRIBUTES VECTOR : uniform(normal_x, normal_y, normal_z) &amp;nbsp;:: Calculate_Sines&lt;/P&gt;

&lt;P&gt;Read the documentation, I havn't tried this in your code example.&lt;/P&gt;

&lt;P&gt;Jim Dempsey&lt;/P&gt;</description>
      <pubDate>Sat, 05 Sep 2015 00:49:18 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Using-omp-declare-simd-in-an-elemental-subroutine/m-p/1013609#M106572</guid>
      <dc:creator>jimdempseyatthecove</dc:creator>
      <dc:date>2015-09-05T00:49:18Z</dc:date>
    </item>
    <item>
      <title>Thank you Jim. That does work</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Using-omp-declare-simd-in-an-elemental-subroutine/m-p/1013610#M106573</link>
      <description>&lt;P&gt;Thank you Jim. That does work, but it's not standard Fortran 2003 any more. That seems like a step backward.&lt;/P&gt;

&lt;P&gt;So, either:&lt;/P&gt;

&lt;P&gt;- &amp;nbsp; this is genuinely non-conforming code, and the Intel compiler is wrong to allow it with a non-standard directive (not to mention the Intel documentation being wrong to recommend it).&lt;/P&gt;

&lt;P&gt;or&lt;/P&gt;

&lt;P&gt;- &amp;nbsp;this is in fact standard-conforming code and the fact that the new Fortran compiler won't compile it, when the old Fortran compiler did, is a new regression bug in the 16.0 compiler.&lt;/P&gt;

&lt;P&gt;I think I need to wait for someone from Intel to reply, hopefully on Monday.&lt;/P&gt;</description>
      <pubDate>Sat, 05 Sep 2015 09:50:33 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Using-omp-declare-simd-in-an-elemental-subroutine/m-p/1013610#M106573</guid>
      <dc:creator>eos_pengwern</dc:creator>
      <dc:date>2015-09-05T09:50:33Z</dc:date>
    </item>
    <item>
      <title>I believe this is coming from</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Using-omp-declare-simd-in-an-elemental-subroutine/m-p/1013611#M106574</link>
      <description>&lt;P&gt;I believe this is coming from improved/corrected OpenMP 4.0 support in 16.0. According to the OpenMP 4.0.0 spec, chapter 2 &lt;STRONG&gt;Directives&lt;/STRONG&gt;, under &lt;STRONG&gt;Restrictions &lt;/STRONG&gt;(pg. 26 paragraph 3) it says:&amp;nbsp; "OpenMP directives may not appear in &lt;STRONG&gt;PURE &lt;/STRONG&gt;or &lt;STRONG&gt;ELEMENTAL &lt;/STRONG&gt;procedures."&lt;/P&gt;

&lt;P&gt;In our 16.0 release we added support for Fortran 2008&amp;nbsp;IMPURE ELEMENTAL. If you declare the routine with IMPURE it will compile.&lt;/P&gt;</description>
      <pubDate>Sat, 05 Sep 2015 10:25:04 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Using-omp-declare-simd-in-an-elemental-subroutine/m-p/1013611#M106574</guid>
      <dc:creator>Kevin_D_Intel</dc:creator>
      <dc:date>2015-09-05T10:25:04Z</dc:date>
    </item>
    <item>
      <title>Thank you Kevin, that nails</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Using-omp-declare-simd-in-an-elemental-subroutine/m-p/1013612#M106575</link>
      <description>&lt;P&gt;Thank you Kevin, that nails it!&lt;/P&gt;</description>
      <pubDate>Sat, 05 Sep 2015 11:03:44 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Using-omp-declare-simd-in-an-elemental-subroutine/m-p/1013612#M106575</guid>
      <dc:creator>eos_pengwern</dc:creator>
      <dc:date>2015-09-05T11:03:44Z</dc:date>
    </item>
    <item>
      <title>Glad to hear that.</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Using-omp-declare-simd-in-an-elemental-subroutine/m-p/1013613#M106576</link>
      <description>&lt;P&gt;Glad to hear that.&lt;/P&gt;

&lt;P&gt;Just a few tidbits from following up on the earlier comments about documentation.&lt;/P&gt;

&lt;P&gt;You wrote earlier&amp;nbsp;“&lt;EM&gt;this is genuinely non-conforming code, and the Intel compiler is wrong to allow it with a non-standard directive (not to mention the Intel documentation being wrong to recommend it)&lt;/EM&gt;.” and I want to ensure we correct the documentation. I read this as saying we might be suggesting using &lt;STRONG&gt;!omp$ simd &lt;/STRONG&gt;within an &lt;STRONG&gt;ELEMENTAL&lt;/STRONG&gt;. Can you point me to what was not clear in the cited article or documentation so we make sure to review/revise that?&lt;/P&gt;

&lt;P&gt;With &lt;STRONG&gt;IMPURE&lt;/STRONG&gt;, your test case also compiles with &lt;STRONG&gt;-qopenmp-simd &lt;/STRONG&gt;(a suggested option in the earlier cited article) which is a nice validation of that option for this small routine. In some extended notes about the new support for &lt;STRONG&gt;IMPURE ELEMENTAL&lt;/STRONG&gt;, there is a caution that the Vectorization quality could be impacted with &lt;STRONG&gt;IMPURE &lt;/STRONG&gt;as the compiler may not be able to optimize with the routine now having side-effects. I checked your routine and find it still vectorizes with &lt;STRONG&gt;IMPURE &lt;/STRONG&gt;with the 16.0 compiler.&lt;/P&gt;

&lt;P&gt;I posted a reply to your earlier post to redirect any reader to this updated discussion.&lt;/P&gt;</description>
      <pubDate>Sat, 05 Sep 2015 12:28:49 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Using-omp-declare-simd-in-an-elemental-subroutine/m-p/1013613#M106576</guid>
      <dc:creator>Kevin_D_Intel</dc:creator>
      <dc:date>2015-09-05T12:28:49Z</dc:date>
    </item>
    <item>
      <title>Thank you Kevin.</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Using-omp-declare-simd-in-an-elemental-subroutine/m-p/1013614#M106577</link>
      <description>&lt;P&gt;Thank you Kevin.&lt;/P&gt;

&lt;P&gt;The relevant part of the cited article (for the avoidance of doubt, this one:&amp;nbsp;https://software.intel.com/en-us/articles/explicit-vector-programming-in-fortran) occurs almost precisely half way through the article, in the section entitled "Calling SIMD-enabled procedures with array arguments". In there, the example given shows an elemental function with &lt;SPAN style="color: rgb(0, 0, 0); font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace; font-size: 14px; line-height: 15.3999996185303px; background-color: rgb(248, 248, 248);"&gt;!dir$ attributes vector&amp;nbsp;&lt;/SPAN&gt;declared, &amp;nbsp;with a comment underneath saying that &lt;SPAN style="color: rgb(0, 0, 0); font-family: Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace; font-size: 14px; line-height: 15.3999996185303px;"&gt;!$omp declare simd&amp;nbsp;&lt;/SPAN&gt;could be used instead.&lt;/P&gt;

&lt;P&gt;I appreciate your help with this.&lt;/P&gt;</description>
      <pubDate>Sat, 05 Sep 2015 12:56:53 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Using-omp-declare-simd-in-an-elemental-subroutine/m-p/1013614#M106577</guid>
      <dc:creator>eos_pengwern</dc:creator>
      <dc:date>2015-09-05T12:56:53Z</dc:date>
    </item>
    <item>
      <title>Ok, thank you. I saw that and</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Using-omp-declare-simd-in-an-elemental-subroutine/m-p/1013615#M106578</link>
      <description>&lt;P&gt;Ok, thank you.&amp;nbsp;I saw that and checked the syntax before replying&amp;nbsp;earlier&amp;nbsp;and it did not trigger an error w/16.0 so&amp;nbsp;I'll follow-up with Development and the article author too.&lt;/P&gt;</description>
      <pubDate>Sat, 05 Sep 2015 13:11:57 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Using-omp-declare-simd-in-an-elemental-subroutine/m-p/1013615#M106578</guid>
      <dc:creator>Kevin_D_Intel</dc:creator>
      <dc:date>2015-09-05T13:11:57Z</dc:date>
    </item>
    <item>
      <title>Quote:eos pengwern wrote:</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Using-omp-declare-simd-in-an-elemental-subroutine/m-p/1013616#M106579</link>
      <description>&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE&gt;eos pengwern wrote:&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;

&lt;P&gt;Thank you Jim. That does work, but it's not standard Fortran 2003 any more. That seems like a step backward.&lt;/P&gt;

&lt;P&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;

&lt;P&gt;However note that, with respect to Keven's non-pure elemental response, in order to get vectoization of that subroutine you must then compile with -openmp enabled. That routine should be declarable as vectorizable with or without OpenMP enabled. The !DIR$ ATTRIBUTES does this.&lt;/P&gt;

&lt;P&gt;Note 2: Technically !$OMP... is not Fortran 2003 either.&lt;/P&gt;

&lt;P&gt;Jim Dempsey&lt;/P&gt;</description>
      <pubDate>Sat, 05 Sep 2015 13:12:12 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Using-omp-declare-simd-in-an-elemental-subroutine/m-p/1013616#M106579</guid>
      <dc:creator>jimdempseyatthecove</dc:creator>
      <dc:date>2015-09-05T13:12:12Z</dc:date>
    </item>
    <item>
      <title>An update. Following</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Using-omp-declare-simd-in-an-elemental-subroutine/m-p/1013617#M106580</link>
      <description>&lt;P&gt;An update. Following additional discussion with Development we now understand the 16.0 compiler’s current handling and issuing error #8807 as shown in the original post will be changed in a future release, and the acceptance within &lt;STRONG&gt;IMPURE ELEMENTAL &lt;/STRONG&gt;was by accident.&lt;/P&gt;

&lt;P&gt;We learned it is the intent to permit use of &lt;STRONG&gt;!$OMP DECLARE SIMD&lt;/STRONG&gt; and &lt;STRONG&gt;!$OMP SIMD&lt;/STRONG&gt; in &lt;STRONG&gt;ELEMENTAL &lt;/STRONG&gt;subprograms, including &lt;STRONG&gt;PURE &lt;/STRONG&gt;and &lt;STRONG&gt;IMPURE ELEMENTAL&lt;/STRONG&gt;; however, ratification within the OpenMP 4.1 specification is required first and then the compiler can be changed to permit these uses.&lt;/P&gt;

&lt;P&gt;I opened a feature enhancement request to enable tracking the changes to the compiler and updating this forum thread when the support is available in a future release.&lt;/P&gt;

&lt;P&gt;(Internal tracking id: DPD200376030)&lt;/P&gt;</description>
      <pubDate>Sat, 12 Sep 2015 08:27:33 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Using-omp-declare-simd-in-an-elemental-subroutine/m-p/1013617#M106580</guid>
      <dc:creator>Kevin_D_Intel</dc:creator>
      <dc:date>2015-09-12T08:27:33Z</dc:date>
    </item>
    <item>
      <title>Thank you Kevin; I appreciate</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Using-omp-declare-simd-in-an-elemental-subroutine/m-p/1013618#M106581</link>
      <description>&lt;P&gt;Thank you Kevin; I appreciate it; I'll stick with the impure elemental declaration for now, but I'll put a comment in my code to the effect that I should try dropping the 'impure' when I upgrade my compiler.&lt;/P&gt;</description>
      <pubDate>Sat, 12 Sep 2015 09:33:46 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Using-omp-declare-simd-in-an-elemental-subroutine/m-p/1013618#M106581</guid>
      <dc:creator>eos_pengwern</dc:creator>
      <dc:date>2015-09-12T09:33:46Z</dc:date>
    </item>
    <item>
      <title>Keven,</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Using-omp-declare-simd-in-an-elemental-subroutine/m-p/1013619#M106582</link>
      <description>&lt;P&gt;Keven,&lt;/P&gt;

&lt;P&gt;How does your compiler team suggest addressing this issue when the program is compiled with OpenMP disabled?&lt;/P&gt;

&lt;P&gt;Getting good SIMD code should not be dependent on OpenMP (when OpenMP is not used).&lt;/P&gt;

&lt;P&gt;IMHO !$OMP SIMD should only affect how the iteration space is partitioned (i.e. into vector size multiples).&lt;/P&gt;

&lt;P&gt;Jim Dempsey&lt;/P&gt;</description>
      <pubDate>Sat, 12 Sep 2015 16:03:14 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Using-omp-declare-simd-in-an-elemental-subroutine/m-p/1013619#M106582</guid>
      <dc:creator>jimdempseyatthecove</dc:creator>
      <dc:date>2015-09-12T16:03:14Z</dc:date>
    </item>
  </channel>
</rss>

