This is an archive of the discontinued LLVM Phabricator instance.

[openmp] Update OMPT declaration and implementation in the runtime
Needs RevisionPublic

Authored by lechenyu on Jul 28 2021, 10:18 AM.


  1. Setup OMPT options and targets in libomptarget's CMakeLists.txt.
  2. Modify omp-tools.h.var according to the latest OpenMP specification (omp-tools.h.var).
  3. Add additional fields into ompt_task_info_t and ompt_thread_info_t to support target-data, target-task-data, and host-op-id (ompt-internal.h).
  4. Set corresponding flags correctly when initializing a target task (kmp_tasking.cpp).
  5. Add wrappers for target-emi callbacks (ompt-general.cpp).
  6. Add callback interfaces for libomptarget in the runtime. The details of OMPT callbacks are transparent to libomptarget and libomptarget only invokes these interfaces when encountering corresponding events (ompt-general.cpp and exports_so.txt).

Diff Detail

Event Timeline

lechenyu created this revision.Jul 28 2021, 10:18 AM
lechenyu requested review of this revision.Jul 28 2021, 10:18 AM
lechenyu updated this revision to Diff 364117.Aug 4 2021, 8:09 AM

Fix format issues

hbae added inline comments.Sep 7 2021, 3:24 PM

Is this an extension?
I could not find it in 5.1, TR10, or in any open ticket.


Same here.

protze.joachim added inline comments.Sep 10 2021, 7:18 AM

The use case for this flag is for omp_target_memcpy and similar functions, where it is possible to copy from one device to another device.
Thanks for the reminder to create an issue for the OpenMP spec. I created #3006 for this

hbae accepted this revision.Sep 15 2021, 7:41 AM
hbae added inline comments.


This revision is now accepted and ready to land.Sep 15 2021, 7:41 AM
jdenny added a subscriber: jdenny.Sep 29 2021, 8:00 AM
protze.joachim requested changes to this revision.Oct 6 2021, 7:52 AM
protze.joachim added a subscriber: dhruvachak.

The commit is put on hold as discussed in 10/6 OpenMP in LLVM call. Someone from AMD (@dhruvachak ?) will work on upstreaming an alternative implementation, which will most probably result in reverting D99803 as well.

This revision now requires changes to proceed.Oct 6 2021, 7:52 AM