Add USE_HCC_LOCK_API.

Default off, if set will compile assuming HCC lock APIs exist.
This commit is contained in:
Ben Sander
2016-04-18 23:50:52 -05:00
rodzic 22d5738f82
commit 3bcefdaa2d
2 zmienionych plików z 11 dodań i 3 usunięć
+8
Wyświetl plik
@@ -253,7 +253,11 @@ hipError_t hipHostRegister(void *hostPtr, size_t sizeBytes, unsigned int flags)
for(int i=0;i<g_deviceCnt;i++){
vecAcc.push_back(g_devices[i]._acc);
}
#if USE_HCC_LOCK_API
am_status = hc::am_memory_host_lock(device->_acc, hostPtr, sizeBytes, &vecAcc[0], vecAcc.size());
#else
am_status = AM_ERROR_MISC;
#endif
if(am_status == AM_SUCCESS){
hip_status = hipSuccess;
}else{
@@ -276,7 +280,11 @@ hipError_t hipHostUnregister(void *hostPtr)
if(hostPtr == NULL){
hip_status = hipErrorInvalidValue;
}else{
#if USE_HCC_LOCK_API
am_status_t am_status = hc::am_memory_host_unlock(device->_acc, hostPtr);
#else
am_status_t am_status = AM_ERROR_MISC;
#endif
if(am_status != AM_SUCCESS){
hip_status = hipErrorHostMemoryNotRegistered;
}