Split files based on functionality and changed cmake file

[ROCm/hip commit: 794007c3e8]
This commit is contained in:
Aditya Atluri
2016-03-24 04:57:30 -05:00
parent 22aba5c9c5
commit 702672c3df
15 changed files with 527 additions and 3185 deletions
+79
View File
@@ -0,0 +1,79 @@
#include "hip_runtime.h"
#include "hcc_detail/hip_hcc.h"
#include "hcc_detail/trace_helper.h"
/**
* @warning HCC returns 0 in *canAccessPeer ; Need to update this function when RT supports P2P
*/
//---
hipError_t hipDeviceCanAccessPeer ( int* canAccessPeer, int device, int peerDevice )
{
HIP_INIT_API(canAccessPeer, device, peerDevice);
*canAccessPeer = false;
return ihipLogStatus(hipSuccess);
}
/**
* @warning Need to update this function when RT supports P2P
*/
//---
hipError_t hipDeviceDisablePeerAccess ( int peerDevice )
{
HIP_INIT_API(peerDevice);
// TODO-p2p
return ihipLogStatus(hipSuccess);
};
/**
* @warning Need to update this function when RT supports P2P
*/
//---
hipError_t hipDeviceEnablePeerAccess ( int peerDevice, unsigned int flags )
{
std::call_once(hip_initialized, ihipInit);
// TODO-p2p
return ihipLogStatus(hipSuccess);
}
//---
hipError_t hipMemcpyPeer ( void* dst, int dstDevice, const void* src, int srcDevice, size_t sizeBytes )
{
std::call_once(hip_initialized, ihipInit);
// HCC has a unified memory architecture so device specifiers are not required.
return hipMemcpy(dst, src, sizeBytes, hipMemcpyDefault);
};
/**
* @bug This function uses a synchronous copy
*/
//---
hipError_t hipMemcpyPeerAsync ( void* dst, int dstDevice, const void* src, int srcDevice, size_t sizeBytes, hipStream_t stream )
{
std::call_once(hip_initialized, ihipInit);
// HCC has a unified memory architecture so device specifiers are not required.
return hipMemcpyAsync(dst, src, sizeBytes, hipMemcpyDefault, stream);
};
/**
* @return #hipSuccess
*/
//---
hipError_t hipDriverGetVersion(int *driverVersion)
{
HIP_INIT_API(driverVersion);
if (driverVersion) {
*driverVersion = 4;
}
return ihipLogStatus(hipSuccess);
}