[llvm] [OFFLOAD] Add a check before calling dataExchange (PR #176853)

via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 20 10:14:54 PST 2026


================
@@ -1005,10 +1005,24 @@ Error olMemcpy_impl(ol_queue_handle_t Queue, void *DstPtr,
     if (auto Res =
             DstDevice->Device->dataSubmit(DstPtr, SrcPtr, Size, QueueImpl))
       return Res;
-  } else {
+  } else if (SrcDevice->Platform.Plugin == DstDevice->Platform.Plugin &&
+             SrcDevice->Platform.Plugin->isDataExchangable(
+                 SrcDevice->Device->getDeviceId(),
+                 DstDevice->Device->getDeviceId())) {
     if (auto Res = SrcDevice->Device->dataExchange(SrcPtr, *DstDevice->Device,
                                                    DstPtr, Size, QueueImpl))
       return Res;
+  } else {
+    if (Queue)
+      olSyncQueue(Queue);
----------------
fineg74 wrote:

Fixed

https://github.com/llvm/llvm-project/pull/176853


More information about the llvm-commits mailing list