[Openmp-commits] [PATCH] D121056: [OpenMP][NFC] Extend the event introduction to allow wait event actions

Ye Luo via Phabricator via Openmp-commits openmp-commits at lists.llvm.org
Sat Mar 5 18:52:03 PST 2022


ye-luo requested changes to this revision.
ye-luo added inline comments.
This revision now requires changes to proceed.


================
Comment at: openmp/libomptarget/include/device.h:141
+  /// Returns OFFLOAD_FAIL if something went wrong, OFFLOAD_SUCCESS otherwise.
+  int waitEventIfNecessary(DeviceTy &Device, AsyncInfoTy &AsyncInfo) const;
 
----------------
both recordEventIfNecessary and waitEventIfNecessary are confusing names "IfNecessary" part.


================
Comment at: openmp/libomptarget/src/device.cpp:46
+  if (!Record && Device.waitEvent(Event, AsyncInfo) != OFFLOAD_SUCCESS) {
+    REPORT("Failed to wait on event " DPxMOD "\n", DPxPTR(Event));
     return OFFLOAD_FAIL;
----------------
Cannot take the logic of Record


================
Comment at: openmp/libomptarget/src/device.cpp:62
+                                             AsyncInfoTy &AsyncInfo) const {
+  return recordOrWaitForEventIfNecessary(*this, Device, AsyncInfo,
+                                         /* Record */ false);
----------------
create  an event without recording it once, waitevent is undefined behavior.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D121056/new/

https://reviews.llvm.org/D121056



More information about the Openmp-commits mailing list