[Openmp-commits] [PATCH] D157605: [OpenMP][OMPT] Fix `target enter data` callback ordering & reported device num

Michael Halkenhäuser via Phabricator via Openmp-commits openmp-commits at lists.llvm.org
Thu Aug 10 05:11:24 PDT 2023


mhalk created this revision.
mhalk added a reviewer: dhruvachak.
Herald added subscribers: guansong, yaxunl.
Herald added a project: All.
mhalk requested review of this revision.
Herald added a reviewer: jdoerfert.
Herald added subscribers: openmp-commits, jplehr, sstefan1.
Herald added a project: OpenMP.

We observed multiple issues, primarily that the `DeviceId` was reported as -1
in certain scenarios. The reason for this is simply that the device is not
initialized at that point. Hence, we need to move the RAII object creation just
after the `checkDeviceAndCtors`, closer to the actual call we want to observe.

This also solves an odering issue where one `target enter data` callback would
be executed before the `Init` callback.
Additionally, this change will also fix that the callbacks corresponding to
`enter / exit data` and `update` in conjunction with `nowait` would not result
in the emission of an OMPT callback.

Added a testcase to cover initialized device number and `omp target` constructs.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D157605

Files:
  openmp/libomptarget/src/interface.cpp
  openmp/libomptarget/test/ompt/veccopy_data.c

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D157605.548986.patch
Type: text/x-patch
Size: 9210 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/openmp-commits/attachments/20230810/af74a426/attachment.bin>


More information about the Openmp-commits mailing list