For P2P, use the peer list when allocating Device memory or pinned host.

Each new allocation is automatically mapped into the address space of
all enabled peers.


[ROCm/clr commit: 97772d6363]
Este commit está contenido en:
Ben Sander
2016-04-06 16:44:31 -05:00
padre 7eb8c10215
commit 2890517a23
Se han modificado 6 ficheros con 59 adiciones y 38 borrados
@@ -35,6 +35,10 @@ THE SOFTWARE.
//Use the new HCC accelerator_view::copy instead of am_copy
#define USE_AV_COPY 0
// Compile peer-to-peer support.
// 2= use upcoming HCC APIs.
#define USE_PEER_TO_PEER 1
//#define INLINE static inline
//---
@@ -523,7 +527,7 @@ public:
bool removePeer(ihipDevice_t *peer);
uint32_t peerCnt() const { return _peerCnt; };
uint32_t peerAgents() const { return _peerAgents; };
hsa_agent_t *peerAgents() const { return _peerAgents; };
private:
@@ -919,19 +919,22 @@ hipError_t hipDeviceCanAccessPeer (int* canAccessPeer, int deviceId, int peerDev
*
* @param [in] peerDeviceId
*
* TODO:cudaErrorPeerAccessNotEnabled and cudaErrorInvalidDevice error not supported in HIP, return hipErrorUnknown
* Returns #hipSuccess, #hipErrorUnknown
* Returns #hipSuccess, #hipErrorPeerAccessNotEnabled
*/
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
*
* TODO:cudaErrorInvalidDevice error not supported in HIP, return hipErrorUnknown
* Returns #hipSuccess, #hipErrorInvalidDevice, #hipErrorInvalidValue, #hipErrorUnknown
* Returns #hipSuccess, #hipErrorInvalidDevice, #hipErrorInvalidValue, #hipErrorPeerAccessAlreadyEnabled
*/
hipError_t hipDeviceEnablePeerAccess (int peerDeviceId, unsigned int flags);