Skip to content

Commit 46f76ff

Browse files
author
Hugh Delaney
committed
Update queue if copying from different device
If we need to copy from a different queue to the one passed to the UR entry point, we should make all operations work on that different queue.
1 parent 776317a commit 46f76ff

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

source/adapters/cuda/enqueue.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1025,7 +1025,8 @@ UR_APIEXPORT ur_result_t UR_APICALL urEnqueueMemImageRead(
10251025
if (hImage->LastEventWritingToMemObj &&
10261026
hImage->LastEventWritingToMemObj->getQueue()->getDevice() !=
10271027
hQueue->getDevice()) {
1028-
Device = hImage->LastEventWritingToMemObj->getQueue()->getDevice();
1028+
hQueue = hImage->LastEventWritingToMemObj->getQueue();
1029+
Device = hQueue->getDevice();
10291030
ScopedContext Active(Device);
10301031
Stream = CUstream{0}; // Default stream for different device
10311032
// We may have to wait for an event on another queue if it is the last

0 commit comments

Comments
 (0)