[Openmp-commits] [PATCH] D16631: [OMPT] Workaround clang failing with 'declare target'

Jonas Hahnfeld via Openmp-commits openmp-commits at lists.llvm.org
Wed Jan 27 07:29:48 PST 2016


Hahnfeld created this revision.
Hahnfeld added reviewers: jlpeyton, AndreyChurbanov, ABataev.
Hahnfeld added subscribers: tcramer, openmp-commits.

Current clang trunk reports `_OPENMP` to be 201307 = OpenMP 4.0. It doesn't recognize `#pragma omp declare target` though (patch still pending) and therefore fails compilation.

http://reviews.llvm.org/D16631

Files:
  runtime/src/include/30/ompt.h.var
  runtime/src/include/40/ompt.h.var
  runtime/src/include/41/ompt.h.var

Index: runtime/src/include/41/ompt.h.var
===================================================================
--- runtime/src/include/41/ompt.h.var
+++ runtime/src/include/41/ompt.h.var
@@ -461,14 +461,15 @@
  ***************************************************************************/
 
 /* control */
-#if defined(_OPENMP) && (_OPENMP >= 201307)
+// FIXME: remove workaround for clang
+#if !defined(__clang__) && defined(_OPENMP) && (_OPENMP >= 201307)
 #pragma omp declare target
 #endif
 void ompt_control(
     uint64_t command,
     uint64_t modifier
 );
-#if defined(_OPENMP) && (_OPENMP >= 201307)
+#if !defined(__clang__) && defined(_OPENMP) && (_OPENMP >= 201307)
 #pragma omp end declare target
 #endif
 
Index: runtime/src/include/40/ompt.h.var
===================================================================
--- runtime/src/include/40/ompt.h.var
+++ runtime/src/include/40/ompt.h.var
@@ -461,14 +461,15 @@
  ***************************************************************************/
 
 /* control */
-#if defined(_OPENMP) && (_OPENMP >= 201307)
+// FIXME: remove workaround for clang
+#if !defined(__clang__) && defined(_OPENMP) && (_OPENMP >= 201307)
 #pragma omp declare target
 #endif
 void ompt_control(
     uint64_t command,
     uint64_t modifier
 );
-#if defined(_OPENMP) && (_OPENMP >= 201307)
+#if !defined(__clang__) && defined(_OPENMP) && (_OPENMP >= 201307)
 #pragma omp end declare target
 #endif
 
Index: runtime/src/include/30/ompt.h.var
===================================================================
--- runtime/src/include/30/ompt.h.var
+++ runtime/src/include/30/ompt.h.var
@@ -461,14 +461,15 @@
  ***************************************************************************/
 
 /* control */
-#if defined(_OPENMP) && (_OPENMP >= 201307)
+// FIXME: remove workaround for clang
+#if !defined(__clang__) && defined(_OPENMP) && (_OPENMP >= 201307)
 #pragma omp declare target
 #endif
 void ompt_control(
     uint64_t command,
     uint64_t modifier
 );
-#if defined(_OPENMP) && (_OPENMP >= 201307)
+#if !defined(__clang__) && defined(_OPENMP) && (_OPENMP >= 201307)
 #pragma omp end declare target
 #endif
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D16631.46133.patch
Type: text/x-patch
Size: 2148 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/openmp-commits/attachments/20160127/82b4c442/attachment.bin>


More information about the Openmp-commits mailing list