HIP: Heterogenous-computing Interface for Portability
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Functions
Device Memory Access

Functions

hipError_t hipDeviceCanAccessPeer (int *canAccessPeer, int deviceId, int peerDeviceId)
 Determine if a device can access a peer's memory. More...
 
hipError_t hipDeviceEnablePeerAccess (int peerDeviceId, unsigned int flags)
 Enable direct access from current device's virtual address space to memory allocations physically located on a peer device. More...
 
hipError_t hipDeviceDisablePeerAccess (int peerDeviceId)
 Disable direct access from current device's virtual address space to memory allocations physically located on a peer device. More...
 

Detailed Description

----------------------------------------------------------------------------------------------—

Warning
PeerToPeer support is experimental.

Function Documentation

hipError_t hipDeviceCanAccessPeer ( int *  canAccessPeer,
int  deviceId,
int  peerDeviceId 
)

Determine if a device can access a peer's memory.

Parameters
[out]canAccessPeerReturns the peer access capability (0 or 1)
[in]device- device from where memory may be accessed.
[in]peerDevice- device where memory is physically located

Returns "1" in canAccessPeer if the specified device is capable of directly accessing memory physically located on peerDevice , or "0" if not.

Returns "0" in canAccessPeer if deviceId == peerDeviceId, and both are valid devices : a device is not a peer of itself.

Returns
hipSuccess,
hipErrorInvalidDevice if deviceId or peerDeviceId are not valid devices
Warning
PeerToPeer support is experimental.

HCC returns 0 in *canAccessPeer ; Need to update this function when RT supports P2P

hipError_t hipDeviceDisablePeerAccess ( int  peerDeviceId)

Disable direct access from current device's virtual address space to memory allocations physically located on a peer device.

Returns hipErrorPeerAccessNotEnabled if direct access to memory on peerDevice has not yet been enabled from the current device.

Parameters
[in]peerDeviceId
Returns
hipSuccess, hipErrorPeerAccessNotEnabled
Warning
PeerToPeer support is experimental.
hipError_t hipDeviceEnablePeerAccess ( int  peerDeviceId,
unsigned int  flags 
)

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.

Parameters
[in]peerDeviceId
[in]flagsReturns hipSuccess, hipErrorInvalidDevice, hipErrorInvalidValue,
Returns
hipErrorPeerAccessAlreadyEnabled if peer access is already enabled for this device.
Warning
PeerToPeer support is experimental.