SWDEV-262857: minor fix for D2D

Change-Id: Ica3cb9108e7a0d40d6a910f318df0a2420145603


[ROCm/clr commit: 0e4b4255b2]
This commit is contained in:
Sarbojit Sarkar
2020-12-16 07:02:27 -05:00
committed by Sarbojit Sarkar
parent cd827fad4d
commit 81f54bcdd3
+9 -12
View File
@@ -414,20 +414,17 @@ bool TwoMemoryArgsCommand::validatePeerMemory(){
dstDevices.size() == 1 &&
srcDevices[0] != dstDevices[0]) {
device::Memory* mem1 = memory1_->getDeviceMemory(*srcDevices[0]);
if (queue_device != srcDevices[0]) {
if (!mem1->getAllowedPeerAccess()) {
void* src = reinterpret_cast<void*>(mem1->virtualAddress());
accessAllowed = srcDevices[0]->deviceAllowAccess(src);
mem1->setAllowedPeerAccess(true);
}
if (!mem1->getAllowedPeerAccess()) {
void* src = reinterpret_cast<void*>(mem1->virtualAddress());
accessAllowed = srcDevices[0]->deviceAllowAccess(src);
mem1->setAllowedPeerAccess(true);
}
device::Memory* mem2 = memory2_->getDeviceMemory(*dstDevices[0]);
if (queue_device != dstDevices[0] && accessAllowed == true) {
if (!mem2->getAllowedPeerAccess()) {
void* dst = reinterpret_cast<void*>(mem2->virtualAddress());
accessAllowed = dstDevices[0]->deviceAllowAccess(dst);
mem2->setAllowedPeerAccess(true);
}
if (!mem2->getAllowedPeerAccess()) {
void* dst = reinterpret_cast<void*>(mem2->virtualAddress());
accessAllowed &= dstDevices[0]->deviceAllowAccess(dst);
mem2->setAllowedPeerAccess(true);
}
}
}