[Openmp-commits] [PATCH] D153837: Synchronize after each GPU action in the nextgen plugin

Kevin Sala via Phabricator via Openmp-commits openmp-commits at lists.llvm.org
Mon Jul 17 02:03:22 PDT 2023


kevinsala added inline comments.


================
Comment at: openmp/libomptarget/plugins-nextgen/common/PluginInterface/PluginInterface.cpp:213
+  // synchronize early here.
+  BoolEnvar ForceSynchronize("LIBOMPTARGET_FORCE_SYNCHRONIZE");
+  if (ForceSynchronize && !Err)
----------------
We could define this variable as static to initialize just once.


================
Comment at: openmp/libomptarget/plugins-nextgen/common/PluginInterface/PluginInterface.cpp:215
+  if (ForceSynchronize && !Err)
+    Err = Device.synchronize(AsyncInfoPtr);
+
----------------
jdoerfert wrote:
> Are we sure that this has the desired effect? Also, do we need to check for the presence of Queue?
We could generalize it and merge with the `if` below (line 221):

```
if ((ForceSynchronization || AsyncInfoPtr == &LocalAsyncInfo) && AsyncInfoPtr->Queue && !Err)
  Err = Device.synchronize(AsyncInfoPtr);
```


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

https://reviews.llvm.org/D153837



More information about the Openmp-commits mailing list