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:
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user