[Openmp-commits] [llvm] [openmp] [OpenMP][OMPT] Error when registering EMI and non-EMI callbacks (PR #213697)

Michael Halkenhäuser via Openmp-commits openmp-commits at lists.llvm.org
Thu Aug 6 08:40:55 PDT 2026


================
@@ -597,10 +597,35 @@ OMPT_API_ROUTINE ompt_set_result_t ompt_set_callback(ompt_callbacks_t which,
     else                                                                       \
       return ompt_set_always;
 
-    FOREACH_OMPT_EVENT(ompt_event_macro)
+    FOREACH_OMPT_HOST_EVENT(ompt_event_macro)
+    FOREACH_OMPT_DEVICE_EVENT(ompt_event_macro)
 
 #undef ompt_event_macro
 
+    // OpenMP v5.2, p. 503, l. 18-20:
+    // Restrictions to the ompt_callback_target_emi and ompt_callback_target
+    // callbacks are as follows:
+    //   These callbacks must not be registered at the same time.
+    //
+    // Similar restrictions apply to target_data_op, target_submit,
+    // and target_map. Hence, handle registration of them separately to ensure
+    // only one can be registered at the same time. */
----------------
mhalk wrote:

Stray ` */`?

https://github.com/llvm/llvm-project/pull/213697


More information about the Openmp-commits mailing list