[Openmp-commits] [PATCH] D84996: [OpenMP] Fixed the issue that target memory deallocation might be called when they're being used

Shilei Tian via Phabricator via Openmp-commits openmp-commits at lists.llvm.org
Thu Jul 30 19:07:35 PDT 2020


tianshilei1992 added inline comments.


================
Comment at: openmp/libomptarget/src/omptarget.cpp:599
+  // We need to synchronize before deallocating data
+  Ret = Device.synchronize(AsyncInfo);
+  if (Ret != OFFLOAD_SUCCESS) {
----------------
ye-luo wrote:
> If targetDataEnd is not called from target.
> AsyncInfo can be nullptr.
> AsyncInfo->Queue also be nullptr in "target exit data nowait" if there is no transfer.
> 
> At the end of target(), the synchronize needs to check AsyncInfo->Queue.
There is no need to synchronize at the end of `target`. I forgot to remove it.
For other cases, let me think about them.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D84996



More information about the Openmp-commits mailing list