<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body dir="auto">
Hi Hal,
<div>As soon as we get the support for 4.5, including offloading. Otherwise there always are going to be some people blaming the compiler for not supporting 4.5 in full. Will try to support it ASAP. </div>
<div>Meanwhile, you can use -fopenmp-version=45 option to force to 4.5 <br>
<br>
<div id="AppleMailSignature">Best regards,
<div>Alexey Bataev</div>
</div>
<div><br>
2 окт. 2017 г., в 19:53, Hal Finkel <<a href="mailto:hfinkel@anl.gov">hfinkel@anl.gov</a>> написал(а):<br>
<br>
</div>
<blockquote type="cite">
<div><span>Hi, Alexey,</span><br>
<span></span><br>
<span>At what point can we switch, by default, to reporting a version for _OPENMP corresponding to 4.x? We're missing out on some OpenMP simd directives because the source code guards them with '#if _OPENMP >= 201307' or similar.</span><br>
<span></span><br>
<span>Thanks again,</span><br>
<span>Hal</span><br>
<span></span><br>
<span>On 05/26/2016 11:13 PM, Alexey Bataev via cfe-commits wrote:</span><br>
<blockquote type="cite"><span>Author: abataev</span><br>
</blockquote>
<blockquote type="cite"><span>Date: Thu May 26 23:13:39 2016</span><br>
</blockquote>
<blockquote type="cite"><span>New Revision: 270962</span><br>
</blockquote>
<blockquote type="cite"><span></span><br>
</blockquote>
<blockquote type="cite"><span>URL: <a href="http://llvm.org/viewvc/llvm-project?rev=270962&view=rev">
http://llvm.org/viewvc/llvm-project?rev=270962&view=rev</a></span><br>
</blockquote>
<blockquote type="cite"><span>Log:</span><br>
</blockquote>
<blockquote type="cite"><span>[OPENMP] Fixed processing of '-fopenmp-version=' option and test.</span><br>
</blockquote>
<blockquote type="cite"><span></span><br>
</blockquote>
<blockquote type="cite"><span>Modified:</span><br>
</blockquote>
<blockquote type="cite"><span>    cfe/trunk/lib/Driver/Tools.cpp</span><br>
</blockquote>
<blockquote type="cite"><span>    cfe/trunk/lib/Frontend/CompilerInvocation.cpp</span><br>
</blockquote>
<blockquote type="cite"><span>    cfe/trunk/lib/Frontend/InitPreprocessor.cpp</span><br>
</blockquote>
<blockquote type="cite"><span>    cfe/trunk/test/OpenMP/driver.c</span><br>
</blockquote>
<blockquote type="cite"><span></span><br>
</blockquote>
<blockquote type="cite"><span>Modified: cfe/trunk/lib/Driver/Tools.cpp</span><br>
</blockquote>
<blockquote type="cite"><span>URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/Tools.cpp?rev=270962&r1=270961&r2=270962&view=diff">
http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/Tools.cpp?rev=270962&r1=270961&r2=270962&view=diff</a></span><br>
</blockquote>
<blockquote type="cite"><span>==============================================================================</span><br>
</blockquote>
<blockquote type="cite"><span>--- cfe/trunk/lib/Driver/Tools.cpp (original)</span><br>
</blockquote>
<blockquote type="cite"><span>+++ cfe/trunk/lib/Driver/Tools.cpp Thu May 26 23:13:39 2016</span><br>
</blockquote>
<blockquote type="cite"><span>@@ -4864,7 +4864,6 @@ void Clang::ConstructJob(Compilation &C,</span><br>
</blockquote>
<blockquote type="cite"><span>   // Forward flags for OpenMP</span><br>
</blockquote>
<blockquote type="cite"><span>   if (Args.hasFlag(options::OPT_fopenmp, options::OPT_fopenmp_EQ,</span><br>
</blockquote>
<blockquote type="cite"><span>                    options::OPT_fno_openmp, false)) {</span><br>
</blockquote>
<blockquote type="cite"><span>-    Args.AddAllArgs(CmdArgs, options::OPT_fopenmp_version_EQ);</span><br>
</blockquote>
<blockquote type="cite"><span>     switch (getOpenMPRuntime(getToolChain(), Args)) {</span><br>
</blockquote>
<blockquote type="cite"><span>     case OMPRT_OMP:</span><br>
</blockquote>
<blockquote type="cite"><span>     case OMPRT_IOMP5:</span><br>
</blockquote>
<blockquote type="cite"><span>@@ -4877,6 +4876,7 @@ void Clang::ConstructJob(Compilation &C,</span><br>
</blockquote>
<blockquote type="cite"><span>       if (!Args.hasFlag(options::OPT_fopenmp_use_tls,</span><br>
</blockquote>
<blockquote type="cite"><span>                         options::OPT_fnoopenmp_use_tls, /*Default=*/true))</span><br>
</blockquote>
<blockquote type="cite"><span>         CmdArgs.push_back("-fnoopenmp-use-tls");</span><br>
</blockquote>
<blockquote type="cite"><span>+      Args.AddAllArgs(CmdArgs, options::OPT_fopenmp_version_EQ);</span><br>
</blockquote>
<blockquote type="cite"><span>       break;</span><br>
</blockquote>
<blockquote type="cite"><span>     default:</span><br>
</blockquote>
<blockquote type="cite"><span>       // By default, if Clang doesn't know how to generate useful OpenMP code</span><br>
</blockquote>
<blockquote type="cite"><span></span><br>
</blockquote>
<blockquote type="cite"><span>Modified: cfe/trunk/lib/Frontend/CompilerInvocation.cpp</span><br>
</blockquote>
<blockquote type="cite"><span>URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Frontend/CompilerInvocation.cpp?rev=270962&r1=270961&r2=270962&view=diff">
http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Frontend/CompilerInvocation.cpp?rev=270962&r1=270961&r2=270962&view=diff</a></span><br>
</blockquote>
<blockquote type="cite"><span>==============================================================================</span><br>
</blockquote>
<blockquote type="cite"><span>--- cfe/trunk/lib/Frontend/CompilerInvocation.cpp (original)</span><br>
</blockquote>
<blockquote type="cite"><span>+++ cfe/trunk/lib/Frontend/CompilerInvocation.cpp Thu May 26 23:13:39 2016</span><br>
</blockquote>
<blockquote type="cite"><span>@@ -1954,15 +1954,16 @@ static void ParseLangArgs(LangOptions &O</span><br>
</blockquote>
<blockquote type="cite"><span>   }</span><br>
</blockquote>
<blockquote type="cite"><span>     // Check if -fopenmp is specified.</span><br>
</blockquote>
<blockquote type="cite"><span>-  Opts.OpenMP = Args.hasArg(options::OPT_fopenmp);</span><br>
</blockquote>
<blockquote type="cite"><span>+  Opts.OpenMP = Args.hasArg(options::OPT_fopenmp) ? 1 : 0;</span><br>
</blockquote>
<blockquote type="cite"><span>   Opts.OpenMPUseTLS =</span><br>
</blockquote>
<blockquote type="cite"><span>       Opts.OpenMP && !Args.hasArg(options::OPT_fnoopenmp_use_tls);</span><br>
</blockquote>
<blockquote type="cite"><span>   Opts.OpenMPIsDevice =</span><br>
</blockquote>
<blockquote type="cite"><span>       Opts.OpenMP && Args.hasArg(options::OPT_fopenmp_is_device);</span><br>
</blockquote>
<blockquote type="cite"><span>     if (Opts.OpenMP) {</span><br>
</blockquote>
<blockquote type="cite"><span>-    if (int Version = getLastArgIntValue(Args, OPT_fopenmp_version_EQ,</span><br>
</blockquote>
<blockquote type="cite"><span>-                                         Opts.OpenMP, Diags))</span><br>
</blockquote>
<blockquote type="cite"><span>+    int Version =</span><br>
</blockquote>
<blockquote type="cite"><span>+        getLastArgIntValue(Args, OPT_fopenmp_version_EQ, Opts.OpenMP, Diags);</span><br>
</blockquote>
<blockquote type="cite"><span>+    if (Version != 0)</span><br>
</blockquote>
<blockquote type="cite"><span>       Opts.OpenMP = Version;</span><br>
</blockquote>
<blockquote type="cite"><span>     // Provide diagnostic when a given target is not expected to be an OpenMP</span><br>
</blockquote>
<blockquote type="cite"><span>     // device or host.</span><br>
</blockquote>
<blockquote type="cite"><span></span><br>
</blockquote>
<blockquote type="cite"><span>Modified: cfe/trunk/lib/Frontend/InitPreprocessor.cpp</span><br>
</blockquote>
<blockquote type="cite"><span>URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Frontend/InitPreprocessor.cpp?rev=270962&r1=270961&r2=270962&view=diff">
http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Frontend/InitPreprocessor.cpp?rev=270962&r1=270961&r2=270962&view=diff</a></span><br>
</blockquote>
<blockquote type="cite"><span>==============================================================================</span><br>
</blockquote>
<blockquote type="cite"><span>--- cfe/trunk/lib/Frontend/InitPreprocessor.cpp (original)</span><br>
</blockquote>
<blockquote type="cite"><span>+++ cfe/trunk/lib/Frontend/InitPreprocessor.cpp Thu May 26 23:13:39 2016</span><br>
</blockquote>
<blockquote type="cite"><span>@@ -922,24 +922,24 @@ static void InitializePredefinedMacros(c</span><br>
</blockquote>
<blockquote type="cite"><span>   }</span><br>
</blockquote>
<blockquote type="cite"><span>     // OpenMP definition</span><br>
</blockquote>
<blockquote type="cite"><span>-  if (LangOpts.OpenMP) {</span><br>
</blockquote>
<blockquote type="cite"><span>-    // OpenMP 2.2:</span><br>
</blockquote>
<blockquote type="cite"><span>-    //   In implementations that support a preprocessor, the _OPENMP</span><br>
</blockquote>
<blockquote type="cite"><span>-    //   macro name is defined to have the decimal value yyyymm where</span><br>
</blockquote>
<blockquote type="cite"><span>-    //   yyyy and mm are the year and the month designations of the</span><br>
</blockquote>
<blockquote type="cite"><span>-    //   version of the OpenMP API that the implementation support.</span><br>
</blockquote>
<blockquote type="cite"><span>-    switch (LangOpts.OpenMP) {</span><br>
</blockquote>
<blockquote type="cite"><span>-    case 40:</span><br>
</blockquote>
<blockquote type="cite"><span>-      Builder.defineMacro("_OPENMP", "201307");</span><br>
</blockquote>
<blockquote type="cite"><span>-      break;</span><br>
</blockquote>
<blockquote type="cite"><span>-    case 45:</span><br>
</blockquote>
<blockquote type="cite"><span>-      Builder.defineMacro("_OPENMP", "201511");</span><br>
</blockquote>
<blockquote type="cite"><span>-      break;</span><br>
</blockquote>
<blockquote type="cite"><span>-    default:</span><br>
</blockquote>
<blockquote type="cite"><span>-      // Default version is OpenMP 3.1</span><br>
</blockquote>
<blockquote type="cite"><span>-      Builder.defineMacro("_OPENMP", "201107");</span><br>
</blockquote>
<blockquote type="cite"><span>-      break;</span><br>
</blockquote>
<blockquote type="cite"><span>-    }</span><br>
</blockquote>
<blockquote type="cite"><span>+  // OpenMP 2.2:</span><br>
</blockquote>
<blockquote type="cite"><span>+  //   In implementations that support a preprocessor, the _OPENMP</span><br>
</blockquote>
<blockquote type="cite"><span>+  //   macro name is defined to have the decimal value yyyymm where</span><br>
</blockquote>
<blockquote type="cite"><span>+  //   yyyy and mm are the year and the month designations of the</span><br>
</blockquote>
<blockquote type="cite"><span>+  //   version of the OpenMP API that the implementation support.</span><br>
</blockquote>
<blockquote type="cite"><span>+  switch (LangOpts.OpenMP) {</span><br>
</blockquote>
<blockquote type="cite"><span>+  case 0:</span><br>
</blockquote>
<blockquote type="cite"><span>+    break;</span><br>
</blockquote>
<blockquote type="cite"><span>+  case 40:</span><br>
</blockquote>
<blockquote type="cite"><span>+    Builder.defineMacro("_OPENMP", "201307");</span><br>
</blockquote>
<blockquote type="cite"><span>+    break;</span><br>
</blockquote>
<blockquote type="cite"><span>+  case 45:</span><br>
</blockquote>
<blockquote type="cite"><span>+    Builder.defineMacro("_OPENMP", "201511");</span><br>
</blockquote>
<blockquote type="cite"><span>+    break;</span><br>
</blockquote>
<blockquote type="cite"><span>+  default:</span><br>
</blockquote>
<blockquote type="cite"><span>+    // Default version is OpenMP 3.1</span><br>
</blockquote>
<blockquote type="cite"><span>+    Builder.defineMacro("_OPENMP", "201107");</span><br>
</blockquote>
<blockquote type="cite"><span>+    break;</span><br>
</blockquote>
<blockquote type="cite"><span>   }</span><br>
</blockquote>
<blockquote type="cite"><span>     // CUDA device path compilaton</span><br>
</blockquote>
<blockquote type="cite"><span></span><br>
</blockquote>
<blockquote type="cite"><span>Modified: cfe/trunk/test/OpenMP/driver.c</span><br>
</blockquote>
<blockquote type="cite"><span>URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/test/OpenMP/driver.c?rev=270962&r1=270961&r2=270962&view=diff">
http://llvm.org/viewvc/llvm-project/cfe/trunk/test/OpenMP/driver.c?rev=270962&r1=270961&r2=270962&view=diff</a></span><br>
</blockquote>
<blockquote type="cite"><span>==============================================================================</span><br>
</blockquote>
<blockquote type="cite"><span>--- cfe/trunk/test/OpenMP/driver.c (original)</span><br>
</blockquote>
<blockquote type="cite"><span>+++ cfe/trunk/test/OpenMP/driver.c Thu May 26 23:13:39 2016</span><br>
</blockquote>
<blockquote type="cite"><span>@@ -8,17 +8,17 @@</span><br>
</blockquote>
<blockquote type="cite"><span> // CHECK-NO-TLS: -cc1</span><br>
</blockquote>
<blockquote type="cite"><span> // CHECK-NO-TLS-SAME: -fnoopenmp-use-tls</span><br>
</blockquote>
<blockquote type="cite"><span> //</span><br>
</blockquote>
<blockquote type="cite"><span>-// RUN: %clang %s -c -E -dM -fopenmp | FileCheck --check-prefix=CHECK-DEFAULT-VERSION %s</span><br>
</blockquote>
<blockquote type="cite"><span>-// RUN: %clang %s -c -E -dM -fopenmp -fopenmp-version=1 | FileCheck --check-prefix=CHECK-DEFAULT-VERSION %s</span><br>
</blockquote>
<blockquote type="cite"><span>-// RUN: %clang %s -c -E -dM -fopenmp -fopenmp-version=0 | FileCheck --check-prefix=CHECK-DEFAULT-VERSION %s</span><br>
</blockquote>
<blockquote type="cite"><span>-// RUN: %clang %s -c -E -dM -fopenmp -fopenmp-version=100 | FileCheck --check-prefix=CHECK-DEFAULT-VERSION %s</span><br>
</blockquote>
<blockquote type="cite"><span>-// RUN: %clang %s -c -E -dM -fopenmp -fopenmp-version=31 | FileCheck --check-prefix=CHECK-DEFAULT-VERSION %s</span><br>
</blockquote>
<blockquote type="cite"><span>+// RUN: %clang %s -c -E -dM -fopenmp=libomp | FileCheck --check-prefix=CHECK-DEFAULT-VERSION %s</span><br>
</blockquote>
<blockquote type="cite"><span>+// RUN: %clang %s -c -E -dM -fopenmp=libomp -fopenmp-version=1 | FileCheck --check-prefix=CHECK-DEFAULT-VERSION %s</span><br>
</blockquote>
<blockquote type="cite"><span>+// RUN: %clang %s -c -E -dM -fopenmp=libomp -fopenmp-version=0 | FileCheck --check-prefix=CHECK-DEFAULT-VERSION %s</span><br>
</blockquote>
<blockquote type="cite"><span>+// RUN: %clang %s -c -E -dM -fopenmp=libomp -fopenmp-version=100 | FileCheck --check-prefix=CHECK-DEFAULT-VERSION %s</span><br>
</blockquote>
<blockquote type="cite"><span>+// RUN: %clang %s -c -E -dM -fopenmp=libomp -fopenmp-version=31 | FileCheck --check-prefix=CHECK-DEFAULT-VERSION %s</span><br>
</blockquote>
<blockquote type="cite"><span> // CHECK-DEFAULT-VERSION: #define _OPENMP 201107</span><br>
</blockquote>
<blockquote type="cite"><span> -// RUN: %clang %s -c -E -dM -fopenmp -fopenmp-version=40 | FileCheck --check-prefix=CHECK-40-VERSION %s</span><br>
</blockquote>
<blockquote type="cite"><span>+// RUN: %clang %s -c -E -dM -fopenmp=libomp -fopenmp-version=40 | FileCheck --check-prefix=CHECK-40-VERSION %s</span><br>
</blockquote>
<blockquote type="cite"><span> // CHECK-40-VERSION: #define _OPENMP 201307</span><br>
</blockquote>
<blockquote type="cite"><span> -// RUN: %clang %s -c -E -dM -fopenmp -fopenmp-version=45 | FileCheck --check-prefix=CHECK-45-VERSION %s</span><br>
</blockquote>
<blockquote type="cite"><span>+// RUN: %clang %s -c -E -dM -fopenmp=libomp -fopenmp-version=45 | FileCheck --check-prefix=CHECK-45-VERSION %s</span><br>
</blockquote>
<blockquote type="cite"><span> // CHECK-45-VERSION: #define _OPENMP 201511</span><br>
</blockquote>
<blockquote type="cite"><span>   // RUN: %clang %s -c -E -dM -fopenmp-version=1 | FileCheck --check-prefix=CHECK-VERSION %s</span><br>
</blockquote>
<blockquote type="cite"><span></span><br>
</blockquote>
<blockquote type="cite"><span></span><br>
</blockquote>
<blockquote type="cite"><span>_______________________________________________</span><br>
</blockquote>
<blockquote type="cite"><span>cfe-commits mailing list</span><br>
</blockquote>
<blockquote type="cite"><span><a href="mailto:cfe-commits@lists.llvm.org">cfe-commits@lists.llvm.org</a></span><br>
</blockquote>
<blockquote type="cite"><span><a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits">http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits</a></span><br>
</blockquote>
<span></span><br>
<span>-- </span><br>
<span>Hal Finkel</span><br>
<span>Lead, Compiler Technology and Programming Languages</span><br>
<span>Leadership Computing Facility</span><br>
<span>Argonne National Laboratory</span><br>
<span></span><br>
</div>
</blockquote>
</div>
</body>
</html>