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

via Openmp-commits openmp-commits at lists.llvm.org
Fri Aug 7 06:00:30 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;
----------------
jprotze wrote:

A sampling tool can query the state when taking a timer-based sample.
Similarly, sampling tools are the typical consumers of frame information. 

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


More information about the Openmp-commits mailing list