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
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);