SWDEV-272543 - Fix hipDeviceGetP2PAttribute when both devices are same

Change-Id: I3db17a962807565ea134e3cbcefa66d373e2d363


[ROCm/hip commit: 0d7cd231e8]
Tá an tiomantas seo le fáil i:
Satyanvesh Dittakavi tiomanta 2021-02-17 12:41:59 -05:00
1 tuismitheoir c91bc2ba9e
tiomantas db0c3fdaaf
1 comhad athraithe
+1 -1
+1 -1
Féach ar an gComhad
@@ -122,7 +122,7 @@ hipError_t hipDeviceGetP2PAttribute(int* value, hipDeviceP2PAttr attr,
HIP_RETURN(hipErrorInvalidValue);
}
if (srcDevice >= static_cast<int>(g_devices.size())
if (srcDevice == dstDevice || srcDevice >= static_cast<int>(g_devices.size())
|| dstDevice >= static_cast<int>(g_devices.size())) {
HIP_RETURN(hipErrorInvalidDevice);
}