[Openmp-commits] [PATCH] D86307: [OpenMP] Pack first-private arguments to improve efficiency of data transfer

Shilei Tian via Phabricator via Openmp-commits openmp-commits at lists.llvm.org
Thu Aug 20 20:01:48 PDT 2020

tianshilei1992 added inline comments.

Comment at: openmp/libomptarget/src/omptarget.cpp:1017
+       FirstPrivateArgSize, DPxPTR(TgtPtr));
+    // Transfer data to target device. We use synchronous version here in case
+    // the host buffer is deallocated before the transfer is finished.
JonChesterfield wrote:
> This seems target specific. Multiple async copies can easily be cheaper than one larger sync copy.
> How is the lifetime of the host buffer usually managed for async copies?  It seems that keeping it alive until the async copy is done would be reasonable, or we could move ownership of the host buffer into the target plugin which is then responsible for the cleanup.
I’ll change this part back to async copy by taking the buffer out of the function such that we can make sure that it will be deallocated safely.

  rG LLVM Github Monorepo



More information about the Openmp-commits mailing list