[Openmp-commits] [PATCH] D119968: [OpenMP][libomptarget] Delay restore of shadow pointers in structs to after H2D memory copies are completed
Carlo Bertolli via Phabricator via Openmp-commits
openmp-commits at lists.llvm.org
Fri Feb 18 08:09:31 PST 2022
This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rG7b731f4d0bfb: [OpenMP][libomptarget] Delay restore of shadow pointers in structs to after H2D… (authored by carlo.bertolli).
Herald added a project: OpenMP.
Herald added a subscriber: openmp-commits.
Changed prior to commit:
https://reviews.llvm.org/D119968?vs=409468&id=409938#toc
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D119968/new/
https://reviews.llvm.org/D119968
Files:
openmp/libomptarget/src/omptarget.cpp
Index: openmp/libomptarget/src/omptarget.cpp
===================================================================
--- openmp/libomptarget/src/omptarget.cpp
+++ openmp/libomptarget/src/omptarget.cpp
@@ -802,6 +802,10 @@
// If we copied the struct to the host, we need to restore the pointer.
if (ArgTypes[I] & OMP_TGT_MAPTYPE_FROM) {
void **ShadowHstPtrAddr = (void **)Itr->first;
+ // Wait for device-to-host memcopies for whole struct to complete,
+ // before restoring the correct host pointer.
+ if (AsyncInfo.synchronize() != OFFLOAD_SUCCESS)
+ return OFFLOAD_FAIL;
*ShadowHstPtrAddr = Itr->second.HstPtrVal;
DP("Restoring original host pointer value " DPxMOD " for host "
"pointer " DPxMOD "\n",
@@ -885,6 +889,10 @@
auto CB = [&](ShadowPtrListTy::iterator &Itr) {
void **ShadowHstPtrAddr = (void **)Itr->first;
+ // Wait for device-to-host memcopies for whole struct to complete,
+ // before restoring the correct host pointer.
+ if (AsyncInfo.synchronize() != OFFLOAD_SUCCESS)
+ return OFFLOAD_FAIL;
*ShadowHstPtrAddr = Itr->second.HstPtrVal;
DP("Restoring original host pointer value " DPxMOD
" for host pointer " DPxMOD "\n",
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D119968.409938.patch
Type: text/x-patch
Size: 1297 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/openmp-commits/attachments/20220218/7f9c2d48/attachment.bin>
More information about the Openmp-commits
mailing list