[Openmp-commits] [PATCH] D140419: [OpenMP] Disable libomptarget integration on unsupported platforms

Guilherme Valarini via Phabricator via Openmp-commits openmp-commits at lists.llvm.org
Tue Dec 20 11:42:24 PST 2022


This revision was automatically updated to reflect the committed changes.
gValarini marked an inline comment as done.
Closed by commit rG4e32d5cedf19: [OpenMP] Disable libomptarget integration on unsupported platforms (authored by gValarini).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D140419/new/

https://reviews.llvm.org/D140419

Files:
  openmp/runtime/src/kmp_config.h.cmake
  openmp/runtime/src/kmp_tasking.cpp


Index: openmp/runtime/src/kmp_tasking.cpp
===================================================================
--- openmp/runtime/src/kmp_tasking.cpp
+++ openmp/runtime/src/kmp_tasking.cpp
@@ -21,8 +21,10 @@
 #include "ompt-specific.h"
 #endif
 
+#if ENABLE_LIBOMPTARGET
 // Declaration of synchronization function from libomptarget.
 extern "C" void __tgt_target_nowait_query(void **) KMP_WEAK_ATTRIBUTE_INTERNAL;
+#endif
 
 /* forward declaration */
 static void __kmp_enable_tasking(kmp_task_team_t *task_team,
@@ -1798,12 +1800,15 @@
     KMP_FSYNC_ACQUIRED(taskdata); // acquired self (new task)
 #endif
 
+#if ENABLE_LIBOMPTARGET
     if (taskdata->td_target_data.async_handle != NULL) {
       // If we have a valid target async handle, that means that we have already
       // executed the task routine once. We must query for the handle completion
       // instead of re-executing the routine.
       __tgt_target_nowait_query(&taskdata->td_target_data.async_handle);
-    } else if (task->routine != NULL) {
+    } else
+#endif
+    if (task->routine != NULL) {
 #ifdef KMP_GOMP_COMPAT
       if (taskdata->td_flags.native) {
         ((void (*)(void *))(*(task->routine)))(task->shareds);
Index: openmp/runtime/src/kmp_config.h.cmake
===================================================================
--- openmp/runtime/src/kmp_config.h.cmake
+++ openmp/runtime/src/kmp_config.h.cmake
@@ -94,6 +94,8 @@
 #define KMP_HAVE_POSIX_MEMALIGN LIBOMP_HAVE_POSIX_MEMALIGN
 #cmakedefine01 LIBOMP_HAVE__ALIGNED_MALLOC
 #define KMP_HAVE__ALIGNED_MALLOC LIBOMP_HAVE__ALIGNED_MALLOC
+#cmakedefine01 OPENMP_ENABLE_LIBOMPTARGET
+#define ENABLE_LIBOMPTARGET OPENMP_ENABLE_LIBOMPTARGET
 
 // Configured cache line based on architecture
 #if KMP_ARCH_PPC64


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D140419.484342.patch
Type: text/x-patch
Size: 1751 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/openmp-commits/attachments/20221220/29d4c670/attachment.bin>


More information about the Openmp-commits mailing list