[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:39:19 PDT 2020


tianshilei1992 marked an inline comment as done.
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) {
----------------
tianshilei1992 wrote:
> 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.
I added some check here. Nice catch.


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