[Openmp-commits] [openmp] 59a4180 - [OpenMP][libomptarget] Fix AsyncInfoTy object in omp_target_memcpy
Shilei Tian via Openmp-commits
openmp-commits at lists.llvm.org
Wed Nov 2 09:03:55 PDT 2022
Author: Kevin Sala Penadés
Date: 2022-11-02T12:03:49-04:00
New Revision: 59a41809d85ed0e9e073f6b425cc915f6c231e10
URL: https://github.com/llvm/llvm-project/commit/59a41809d85ed0e9e073f6b425cc915f6c231e10
DIFF: https://github.com/llvm/llvm-project/commit/59a41809d85ed0e9e073f6b425cc915f6c231e10.diff
LOG: [OpenMP][libomptarget] Fix AsyncInfoTy object in omp_target_memcpy
The AsyncInfoTy should be created in the same device as the async operation will be issued. In omp_target_memcpy, the AsyncInfoTy for the host to destination device transfer was created referring to the source device.
Reviewed By: tianshilei1992
Differential Revision: https://reviews.llvm.org/D137225
Added:
Modified:
openmp/libomptarget/src/api.cpp
Removed:
################################################################################
diff --git a/openmp/libomptarget/src/api.cpp b/openmp/libomptarget/src/api.cpp
index d65ca0b02864d..f408449f01134 100644
--- a/openmp/libomptarget/src/api.cpp
+++ b/openmp/libomptarget/src/api.cpp
@@ -190,7 +190,7 @@ EXTERN int omp_target_memcpy(void *Dst, const void *Src, size_t Length,
Rc = SrcDev.retrieveData(Buffer, SrcAddr, Length, AsyncInfo);
}
if (Rc == OFFLOAD_SUCCESS) {
- AsyncInfoTy AsyncInfo(SrcDev);
+ AsyncInfoTy AsyncInfo(DstDev);
Rc = DstDev.submitData(DstAddr, Buffer, Length, AsyncInfo);
}
free(Buffer);
More information about the Openmp-commits
mailing list