SWDEV-243576 - Fix hipMemcpy regression.

If the queue device doesn't match the device on any memory object, use the queue device from the memory object.

Change-Id: I5fdcf00494f8391574f4443332c01788b8da44ef


[ROCm/clr commit: e430506f70]
This commit is contained in:
Jason Tang
2020-07-21 12:10:43 -04:00
zatwierdzone przez Subodh Gupta
rodzic 380e2fe752
commit aa179b01a3
+10 -1
Wyświetl plik
@@ -196,7 +196,16 @@ hipError_t ihipMemcpy(void* dst, const void* src, size_t sizeBytes, hipMemcpyKin
return hipErrorInvalidValue;
}
} else {
command = new amd::CopyMemoryCommand(queue, CL_COMMAND_COPY_BUFFER, waitList,
amd::HostQueue* pQueue = &queue;
if (queueDevice != srcMemory->getContext().devices()[0]) {
pQueue = hip::getNullStream(srcMemory->getContext());
amd::Command* cmd = queue.getLastQueuedCommand(true);
if (cmd != nullptr) {
waitList.push_back(cmd);
}
}
command = new amd::CopyMemoryCommand(*pQueue, CL_COMMAND_COPY_BUFFER, waitList,
*srcMemory->asBuffer(), *dstMemory->asBuffer(), sOffset, dOffset, sizeBytes);
}
}