[Openmp-commits] [PATCH] D84381: [OpenMP] Wait for kernel prior to memory deallocation
Shilei Tian via Phabricator via Openmp-commits
openmp-commits at lists.llvm.org
Wed Jul 22 19:55:43 PDT 2020
This revision was automatically updated to reflect the committed changes.
Closed by commit rG9b2832c0897c: [OpenMP] Wait for kernel prior to memory deallocation (authored by tianshilei1992).
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D84381/new/
https://reviews.llvm.org/D84381
Files:
openmp/libomptarget/src/omptarget.cpp
Index: openmp/libomptarget/src/omptarget.cpp
===================================================================
--- openmp/libomptarget/src/omptarget.cpp
+++ openmp/libomptarget/src/omptarget.cpp
@@ -927,6 +927,14 @@
return OFFLOAD_FAIL;
}
+ if (Device.RTL->synchronize) {
+ rc = Device.RTL->synchronize(device_id, &AsyncInfo);
+ if (rc != OFFLOAD_SUCCESS) {
+ DP("Failed to synchronize.\n");
+ return OFFLOAD_FAIL;
+ }
+ }
+
// Deallocate (first-)private arrays
for (auto it : fpArrays) {
int rt = Device.RTL->data_delete(Device.RTLDeviceID, it);
@@ -944,8 +952,5 @@
return OFFLOAD_FAIL;
}
- if (Device.RTL->synchronize)
- return Device.RTL->synchronize(device_id, &AsyncInfo);
-
return OFFLOAD_SUCCESS;
}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D84381.280009.patch
Type: text/x-patch
Size: 768 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/openmp-commits/attachments/20200723/92b7af90/attachment.bin>
More information about the Openmp-commits
mailing list