SWDEV-310181 - Fix for mGPU dtest failure

Change-Id: Id0898bd45e23f2d637bef25a3e69f26d9dc40785


[ROCm/clr commit: 2afeacc858]
이 커밋은 다음에 포함됨:
Sarbojit Sarkar 작성하고 Sarbojit Sarkar가 2021-11-22 01:01:47 -05:00를 커밋함
1 부모 b9d61c4cd8
커밋 04745adf7a
2 파일이 변경됨
+12 -17

검색과 일치하는 파일 없음

+11 -16
파일 보기
@@ -504,24 +504,19 @@ bool TwoMemoryArgsCommand::validatePeerMemory(){
if (queue_device->settings().rocr_backend_) {
const std::vector<Device*>& srcDevices = memory1_->getContext().devices();
const std::vector<Device*>& dstDevices = memory2_->getContext().devices();
// destination and source devices are not same hence
// explicit allow access is needed for P2P access
if (srcDevices.size() == 1 &&
dstDevices.size() == 1 &&
srcDevices[0] != dstDevices[0]) {
device::Memory* mem1 = memory1_->getDeviceMemory(*srcDevices[0]);
if (!mem1->getAllowedPeerAccess()) {
void* src = reinterpret_cast<void*>(mem1->virtualAddress());
accessAllowed = srcDevices[0]->deviceAllowAccess(src);
mem1->setAllowedPeerAccess(true);
}
device::Memory* mem1 = memory1_->getDeviceMemory(*srcDevices[0]);
if (!mem1->getAllowedPeerAccess() && srcDevices.size() == 1) {
void* src = reinterpret_cast<void*>(mem1->virtualAddress());
accessAllowed = srcDevices[0]->deviceAllowAccess(src);
mem1->setAllowedPeerAccess(true);
}
device::Memory* mem2 = memory2_->getDeviceMemory(*dstDevices[0]);
if (!mem2->getAllowedPeerAccess()) {
void* dst = reinterpret_cast<void*>(mem2->virtualAddress());
accessAllowed &= dstDevices[0]->deviceAllowAccess(dst);
mem2->setAllowedPeerAccess(true);
}
device::Memory* mem2 = memory2_->getDeviceMemory(*dstDevices[0]);
if (!mem2->getAllowedPeerAccess() && dstDevices.size() == 1) {
void* dst = reinterpret_cast<void*>(mem2->virtualAddress());
accessAllowed &= dstDevices[0]->deviceAllowAccess(dst);
mem2->setAllowedPeerAccess(true);
}
}
return accessAllowed;