2
0

fix bugs in P2P implementation

- addPeers polarity reversed, would never add.
- check allow_access return value, pipe error to hipMalloc.
Este cometimento está contido em:
Ben Sander
2016-04-09 04:10:57 -05:00
ascendente eeb41955e4
cometimento fb31eaf07b
3 ficheiros modificados com 13 adições e 8 eliminações
+2 -5
Ver ficheiro
@@ -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);
}