fix bugs in P2P implementation

- addPeers polarity reversed, would never add.
- check allow_access return value, pipe error to hipMalloc.
This commit is contained in:
Ben Sander
2016-04-09 04:10:57 -05:00
rodzic fcd1d37ff7
commit 173cff4c1e
3 zmienionych plików z 13 dodań i 8 usunięć
+2 -5
Wyświetl plik
@@ -31,26 +31,23 @@ hipError_t hipDeviceCanAccessPeer (int* canAccessPeer, int deviceId, int peerDe
hipError_t err = hipSuccess;
#if USE_PEER_TO_PEER
auto thisDevice = ihipGetDevice(deviceId);
auto peerDevice = ihipGetDevice(peerDeviceId);
if ((thisDevice != NULL) && (peerDevice != NULL)) {
#if USE_PEER_TO_PEER>=2
*canAccessPeer = peerDevice->_acc.get_is_peer(thisDevice->_acc);
printf ("canAccessPeer=%d\n", *canAccessPeer);
#else
*canAccessPeer = 0;
#endif
} else {
*canAccessPeer = false;
*canAccessPeer = 0;
err = hipErrorInvalidDevice;
}
#else
*canAccessPeer = false;
#endif
return ihipLogStatus(err);
}