SWDEV-255614: Fix Caffe2 Test Failure

Change-Id: I043caa89b2a43dace7f18c739f30d2a7bfa644ca
Fixes the issue when memcpy DtoH is performed on device 0 where the device buffer 
is allocated on device1 and the destination pinned buffer is allocated from device 0.


[ROCm/clr commit: 60ec2a3e46]
Tá an tiomantas seo le fáil i:
Satyanvesh Dittakavi
2020-10-21 08:04:15 -04:00
tuismitheoir 07f463ab3f
tiomantas 8d4b0ecb0c
+3 -1
Féach ar an gComhad
@@ -202,7 +202,9 @@ hipError_t ihipMemcpy(void* dst, const void* src, size_t sizeBytes, hipMemcpyKin
}
} else {
amd::HostQueue* pQueue = &queue;
if ((srcMemory->getContext().devices()[0] == dstMemory->getContext().devices()[0]) &&
if (((srcMemory->getContext().devices()[0] == dstMemory->getContext().devices()[0]) ||
(srcMemory->getContext().devices().size() != 1) ||
(dstMemory->getContext().devices().size() != 1)) &&
(queueDevice != srcMemory->getContext().devices()[0])) {
pQueue = hip::getNullStream(srcMemory->getContext());
amd::Command* cmd = queue.getLastQueuedCommand(true);