[Openmp-commits] [PATCH] D96379: [OpenMP] Unify omptarget API and usage wrt. `__tgt_async_info`

Johannes Doerfert via Phabricator via Openmp-commits openmp-commits at lists.llvm.org
Wed Feb 10 15:05:06 PST 2021


jdoerfert added inline comments.


================
Comment at: openmp/libomptarget/src/omptarget.cpp:644
 
-  // We need to synchronize before deallocating data.
-  // If AsyncInfo is nullptr, the previous data transfer (if has) will be
+  // TODO: We should not synchronized here but pass the AsyncInfo object to the
+  // allocate/deallocate device APIs. We need to synchronize before deallocating
----------------
tianshilei1992 wrote:
> I'm lost in the comment...We don't need the synchronization here if we have async data free.
Clang format mixed the TODO with the comment that was there.

```
  // TODO: We should not synchronized here but pass the AsyncInfo object to the allocate/deallocate device APIs. 

  // We need to synchronize before deallocating
  // data. If AsyncInfo is nullptr, the previous data transfer (if has) will be
  // synchronous, so we don't need to synchronize again. If AsyncInfo->Queue is
  // nullptr, there is no data transfer happened because once there is,
  // AsyncInfo->Queue will not be nullptr, so again, we don't need to
  // synchronize.
```


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D96379



More information about the Openmp-commits mailing list