[Openmp-commits] [PATCH] D96438: [OpenMP] Move synchronization into `__tgt_async_info`

Johannes Doerfert via Phabricator via Openmp-commits openmp-commits at lists.llvm.org
Tue Feb 16 11:30:25 PST 2021


jdoerfert added inline comments.


================
Comment at: openmp/libomptarget/src/omptarget.cpp:647
+  if (AsyncInfo) {
+    Ret = AsyncInfo->synchronize();
     if (Ret != OFFLOAD_SUCCESS)
----------------
tianshilei1992 wrote:
> This will cause `synchronize` to be called twice: one here, and another when `AsyncInfo` is destroyed. For now `__tgt_rtl_synchronize` is not designed to be called on a same object twice because it will `assert(async_info_ptr->Queue)`, and every time we call `synchronize`, `Queue` will be set to `nullptr`.
`AsyncInfoTy::synchronize()` checks the Queue and only forwards the call if it is not null. Calling it twice is OK.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D96438



More information about the Openmp-commits mailing list