Checkpoint initial peer2peer implementation.
このコミットが含まれているのは:
+44
-7
@@ -20,22 +20,44 @@ THE SOFTWARE.
|
||||
#include "hip_runtime.h"
|
||||
#include "hcc_detail/hip_hcc.h"
|
||||
#include "hcc_detail/trace_helper.h"
|
||||
#define USE_PEER_TO_PEER 1
|
||||
|
||||
/**
|
||||
* @warning HCC returns 0 in *canAccessPeer ; Need to update this function when RT supports P2P
|
||||
*/
|
||||
//---
|
||||
hipError_t hipDeviceCanAccessPeer ( int* canAccessPeer, int device, int peerDevice )
|
||||
hipError_t hipDeviceCanAccessPeer ( int* canAccessPeer, int deviceId, int peerDeviceId)
|
||||
{
|
||||
HIP_INIT_API(canAccessPeer, device, peerDevice);
|
||||
HIP_INIT_API(canAccessPeer, deviceId, peerDeviceId);
|
||||
|
||||
hipError_t err = hipSuccess;
|
||||
|
||||
#if USE_PEER_TO_PEER
|
||||
auto device = ihipGetDevice(deviceId);
|
||||
auto peerDevice = ihipGetDevice(peerDeviceId);
|
||||
|
||||
if ((device != NULL) && (peerDevice != NULL)) {
|
||||
#if USE_PEER_TO_PEER==2
|
||||
*canAccessPeer = peerDevice->_acc.is_peer(device->_acc);
|
||||
#else
|
||||
*canAccessPeer = 0;
|
||||
#endif
|
||||
|
||||
} else {
|
||||
*canAccessPeer = false;
|
||||
err = hipErrorInvalidDevice;
|
||||
}
|
||||
|
||||
|
||||
#else
|
||||
*canAccessPeer = false;
|
||||
return ihipLogStatus(hipSuccess);
|
||||
#endif
|
||||
return ihipLogStatus(err);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @warning Need to update this function when RT supports P2P
|
||||
* warning Need to update this function when RT supports P2P
|
||||
*/
|
||||
//---
|
||||
hipError_t hipDeviceDisablePeerAccess ( int peerDevice )
|
||||
@@ -51,11 +73,26 @@ hipError_t hipDeviceDisablePeerAccess ( int peerDevice )
|
||||
* @warning Need to update this function when RT supports P2P
|
||||
*/
|
||||
//---
|
||||
hipError_t hipDeviceEnablePeerAccess ( int peerDevice, unsigned int flags )
|
||||
// Enable registering memory on peerDevice for direct access from the current device.
|
||||
hipError_t hipDeviceEnablePeerAccess (int peerDeviceId, unsigned int flags)
|
||||
{
|
||||
std::call_once(hip_initialized, ihipInit);
|
||||
// TODO-p2p
|
||||
return ihipLogStatus(hipSuccess);
|
||||
|
||||
hipError_t err = hipSuccess;
|
||||
#if USE_PEER_TO_PEER
|
||||
if (flags != 0) {
|
||||
err = hipErrorInvalidValue;
|
||||
} else {
|
||||
auto peerDevice = ihipGetDevice(peerDeviceId);
|
||||
if (peerDevice != NULL) {
|
||||
|
||||
} else {
|
||||
err = hipErrorInvalidDevice;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
return ihipLogStatus(err);
|
||||
}
|
||||
|
||||
|
||||
|
||||
新しいイシューから参照
ユーザーをブロックする