[Openmp-commits] [openmp] [OpenMP][OMPT] Add ompt_set_frame_enter support to libomptarget (PR #201127)

Jan André Reuter via Openmp-commits openmp-commits at lists.llvm.org
Wed Jun 3 05:23:01 PDT 2026


================
@@ -481,6 +481,21 @@ int __ompt_get_task_memory_internal(void **addr, size_t *size, int blocknum) {
   return 0;
 }
 
+//----------------------------------------------------------
+// target region support
+//----------------------------------------------------------
+
+int __ompt_set_frame_enter_internal(void *addr, int flags, int state) {
+  int gtid = __kmp_entry_gtid();
+  kmp_info_t *thr = __kmp_threads[gtid];
+
+  ompt_frame_t *ompt_frame = &OMPT_CUR_TASK_INFO(thr)->frame;
+  OMPT_FRAME_SET(ompt_frame, enter, addr, flags);
+  int old_state = thr->th.ompt_thread_info.state;
+  thr->th.ompt_thread_info.state = ompt_state_work_parallel;
----------------
Thyre wrote:

Can you clarify how this state flag is used later on (by a tool or by `libomptarget`)?
Maybe a comment would help here. In #200165 (5a0933c2d81cedd67fcef43c84b90c367365ae4a), the commit message mentions: 

> [...] enabling profiling tools to observe the host thread context when entering a target region



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


More information about the Openmp-commits mailing list