[Openmp-commits] [PATCH] D112799: [OpenMP][OMPT] Add infrastructure for target_data in ompt-multiplex.h

Joachim Protze via Phabricator via Openmp-commits openmp-commits at lists.llvm.org
Fri Oct 29 04:16:57 PDT 2021


protze.joachim created this revision.
protze.joachim added a reviewer: hbae.
protze.joachim added a project: OpenMP.
Herald added subscribers: guansong, yaxunl.
protze.joachim requested review of this revision.
Herald added a reviewer: jdoerfert.
Herald added a subscriber: sstefan1.

In order to implement the missing target related callbacks in
the multiplexer, we needed to integrate target data in
ompt-multiplex.h.
For that, we add macros and getter functions similar as for
the other tool data objects.

Patch prepared by Semih Burak


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D112799

Files:
  openmp/tools/multiplex/ompt-multiplex.h


Index: openmp/tools/multiplex/ompt-multiplex.h
===================================================================
--- openmp/tools/multiplex/ompt-multiplex.h
+++ openmp/tools/multiplex/ompt-multiplex.h
@@ -120,7 +120,8 @@
 
 #if !defined(OMPT_MULTIPLEX_CUSTOM_GET_CLIENT_THREAD_DATA) ||                  \
     !defined(OMPT_MULTIPLEX_CUSTOM_GET_CLIENT_PARALLEL_DATA) ||                \
-    !defined(OMPT_MULTIPLEX_CUSTOM_GET_CLIENT_TASK_DATA)
+    !defined(OMPT_MULTIPLEX_CUSTOM_GET_CLIENT_TASK_DATA) ||                    \
+    !defined(OMPT_MULTIPLEX_CUSTOM_GET_CLIENT_TARGET_DATA)
 static ompt_multiplex_data_pair_t *
 ompt_multiplex_allocate_data_pair(ompt_data_t *data_pointer) {
   data_pointer->ptr = malloc(sizeof(ompt_multiplex_data_pair_t));
@@ -156,7 +157,8 @@
 }
 #endif //! defined(OMPT_MULTIPLEX_CUSTOM_GET_CLIENT_THREAD_DATA) ||
        //! !defined(OMPT_MULTIPLEX_CUSTOM_GET_CLIENT_PARALLEL_DATA) ||
-       //! !defined(OMPT_MULTIPLEX_CUSTOM_GET_CLIENT_TASK_DATA)
+       //! !defined(OMPT_MULTIPLEX_CUSTOM_GET_CLIENT_TASK_DATA) ||
+       //! !defined(OMPT_MULTIPLEX_CUSTOM_GET_CLIENT_TARGET_DATA)
 
 static ompt_data_t *ompt_multiplex_get_own_thread_data(ompt_data_t *data) {
 #ifndef OMPT_MULTIPLEX_CUSTOM_GET_CLIENT_THREAD_DATA
@@ -182,6 +184,17 @@
 #endif
 }
 
+
+static ompt_data_t *ompt_multiplex_get_own_target_data(ompt_data_t *data) {
+#ifndef OMPT_MULTIPLEX_CUSTOM_GET_CLIENT_TARGET_DATA
+  return ompt_multiplex_get_own_ompt_data(data);
+#else
+  return data;
+#endif
+}
+
+
+
 static ompt_data_t *ompt_multiplex_get_client_thread_data(ompt_data_t *data) {
 #ifndef OMPT_MULTIPLEX_CUSTOM_GET_CLIENT_THREAD_DATA
   return ompt_multiplex_get_client_ompt_data(data);
@@ -206,6 +219,15 @@
 #endif
 }
 
+
+static ompt_data_t *ompt_multiplex_get_client_target_data(ompt_data_t *data) {
+#ifndef OMPT_MULTIPLEX_CUSTOM_GET_CLIENT_TARGET_DATA
+  return ompt_multiplex_get_own_ompt_data(data);
+#else
+  return OMPT_MULTIPLEX_CUSTOM_GET_CLIENT_TARGET_DATA(data);
+#endif
+}
+
 static void ompt_multiplex_callback_mutex_acquire(ompt_mutex_t kind,
                                                   unsigned int hint,
                                                   unsigned int impl,


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D112799.383296.patch
Type: text/x-patch
Size: 2210 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/openmp-commits/attachments/20211029/069c426c/attachment.bin>


More information about the Openmp-commits mailing list