P2p checkpoint.

- set USE_PEER_TO_PEER=3 (requires HCC "am_memtracker_update_peers")
- when enabling peer, turn it on for previously allocated memory.
- hipDeviceCanAccessPeer is no longer self-ware (self does not qualify
  as a peer)
- device peerlist always includes self, so when we call allow_access
  we never remove self access.
- hipDeviceReset() removes old peer mappings.
Tá an tiomantas seo le fáil i:
Ben Sander
2016-04-11 12:52:18 -05:00
tuismitheoir c2d37b4bbd
tiomantas 83f0de7806
D'athraigh 9 comhad le 202 breiseanna agus 54 scriosta
+2 -1
Féach ar an gComhad
@@ -38,7 +38,7 @@ THE SOFTWARE.
// Compile peer-to-peer support.
// >= 2 : use HCC hc:accelerator::get_is_peer
// >= 3 : use hc::am_memtracker_update_peers(...)
#define USE_PEER_TO_PEER 2
#define USE_PEER_TO_PEER 3
//#define INLINE static inline
@@ -526,6 +526,7 @@ public:
bool addPeer(ihipDevice_t *peer);
bool removePeer(ihipDevice_t *peer);
void resetPeers(ihipDevice_t *thisDevice);
uint32_t peerCnt() const { return _peerCnt; };
hsa_agent_t *peerAgents() const { return _peerAgents; };
+23 -14
Féach ar an gComhad
@@ -907,10 +907,33 @@ hipError_t hipMemGetInfo (size_t * free, size_t * total) ;
*
* Returns "1" in @p canAccessPeer if the specified @p device is capable
* of directly accessing memory physically located on peerDevice , or "0" if not.
*
* Returns "0" in @p canAccessPeer if deviceId == peerDeviceId, and both are valid devices : a device is not a peer of itself.
*
*
*
* @returns #hipSuccess,
* @returns #hipErrorInvalidDevice if deviceId or peerDeviceId are not valid devices
*/
hipError_t hipDeviceCanAccessPeer (int* canAccessPeer, int deviceId, int peerDeviceId);
/**
* @brief Enable direct access from current device's virtual address space to memory allocations physically located on a peer device.
*
* Memory which already allocated on peer device will be mapped into the address space of the current device. In addition, all
* future memory allocations on peerDeviceId will be mapped into the address space of the current device when the memory is allocated.
* The peer memory remains accessible from the current device until a call to hipDeviceDisablePeerAccess or hipDeviceReset.
*
*
* @param [in] peerDeviceId
* @param [in] flags
*
* Returns #hipSuccess, #hipErrorInvalidDevice, #hipErrorInvalidValue,
* @returns #hipErrorPeerAccessAlreadyEnabled if peer access is already enabled for this device.
*/
hipError_t hipDeviceEnablePeerAccess (int peerDeviceId, unsigned int flags);
/**
* @brief Disable direct access from current device's virtual address space to memory allocations physically located on a peer device.
@@ -923,20 +946,6 @@ hipError_t hipDeviceCanAccessPeer (int* canAccessPeer, int deviceId, int peerDev
*/
hipError_t hipDeviceDisablePeerAccess (int peerDeviceId);
/**
* @brief Enable direct access from current device's virtual address space to memory allocations physically located on a peer device.
*
* Memory which already allocated on peer device will be mapped into the address space of the current device. In addition, all
* future memory allocations on peerDeviceId will be mapped into the address space of the current device when the memory is allocated.
* The peer memory remains accessible from the current device until a call to hipDeviceDisablePeerAccess or @hipDeviceReset.
*
*
* @param [in] peerDeviceId
* @param [in] flags
*
* Returns #hipSuccess, #hipErrorInvalidDevice, #hipErrorInvalidValue, #hipErrorPeerAccessAlreadyEnabled
*/
hipError_t hipDeviceEnablePeerAccess (int peerDeviceId, unsigned int flags);
/**
* @brief Copies memory from one device to memory on another device.