Corrected Memcpydefault

[ROCm/hip commit: 8dc1bdcbe6]
This commit is contained in:
Aditya Atluri
2016-04-16 17:10:13 -05:00
parent 69f7b859c2
commit 6cd86531b3
4 changed files with 25 additions and 28 deletions
-10
View File
@@ -40,11 +40,7 @@ hipError_t hipDeviceCanAccessPeer (int* canAccessPeer, int deviceId, int peerDe
if (deviceId == peerDeviceId) {
*canAccessPeer = 0;
} else {
#if USE_PEER_TO_PEER>=2
*canAccessPeer = peerDevice->_acc.get_is_peer(thisDevice->_acc);
#else
*canAccessPeer = 0;
#endif
}
} else {
@@ -67,11 +63,7 @@ hipError_t hipDeviceDisablePeerAccess (int peerDeviceId)
auto thisDevice = ihipGetTlsDefaultDevice();
auto peerDevice = ihipGetDevice(peerDeviceId);
if ((thisDevice != NULL) && (peerDevice != NULL)) {
#if USE_PEER_TO_PEER>=2
bool canAccessPeer = peerDevice->_acc.get_is_peer(thisDevice->_acc);
#else
bool canAccessPeer = 0;
#endif
if (! canAccessPeer) {
err = hipErrorInvalidDevice; // P2P not allowed between these devices.
} else if (thisDevice == peerDevice) {
@@ -80,10 +72,8 @@ hipError_t hipDeviceDisablePeerAccess (int peerDeviceId)
LockedAccessor_DeviceCrit_t crit(thisDevice->criticalData());
bool changed = crit->removePeer(peerDevice);
if (changed) {
#if USE_PEER_TO_PEER>=3
// Update the peers for all memory already saved in the tracker:
am_memtracker_update_peers(thisDevice->_acc, crit->peerCnt(), crit->peerAgents());
#endif
} else {
err = hipErrorPeerAccessNotEnabled; // never enabled P2P access.
}