[Openmp-commits] [openmp] c0185dc - Revert "[OpenMP] Wait for kernel prior to memory deallocation"
Shilei Tian via Openmp-commits
openmp-commits at lists.llvm.org
Wed Jul 22 20:03:51 PDT 2020
Author: Shilei Tian
Date: 2020-07-22T23:03:36-04:00
New Revision: c0185dc7df86c763837916771d02c4a5e1b44dbf
URL: https://github.com/llvm/llvm-project/commit/c0185dc7df86c763837916771d02c4a5e1b44dbf
DIFF: https://github.com/llvm/llvm-project/commit/c0185dc7df86c763837916771d02c4a5e1b44dbf.diff
LOG: Revert "[OpenMP] Wait for kernel prior to memory deallocation"
This reverts commit 9b2832c0897c1d39846eee0ad84bf787f05d2d4b.
Added:
Modified:
openmp/libomptarget/src/omptarget.cpp
Removed:
################################################################################
diff --git a/openmp/libomptarget/src/omptarget.cpp b/openmp/libomptarget/src/omptarget.cpp
index a613f2edaf0c..47971b9c0a00 100644
--- a/openmp/libomptarget/src/omptarget.cpp
+++ b/openmp/libomptarget/src/omptarget.cpp
@@ -927,14 +927,6 @@ int target(int64_t device_id, void *host_ptr, int32_t arg_num,
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);
@@ -952,5 +944,8 @@ int target(int64_t device_id, void *host_ptr, int32_t arg_num,
return OFFLOAD_FAIL;
}
+ if (Device.RTL->synchronize)
+ return Device.RTL->synchronize(device_id, &AsyncInfo);
+
return OFFLOAD_SUCCESS;
}
More information about the Openmp-commits
mailing list