improved error returns for hipHostRegister/UnRegister functions

This commit is contained in:
Aditya Atluri
2016-04-15 10:42:31 -05:00
orang tua 26ee986774
melakukan e8902a6e20
3 mengubah file dengan 6 tambahan dan 4 penghapusan
+2
Melihat File
@@ -159,6 +159,8 @@ typedef enum hipError_t {
,hipErrorPeerAccessAlreadyEnabled ///< Peer access was already enabled from the current device.
,hipErrorRuntimeMemory ///< HSA runtime memory call returned error. Typically not seen in production systems.
,hipErrorRuntimeOther ///< HSA runtime call other than memory returned error. Typically not seen in production systems.
,hipErrorHostMemoryAlreadyRegistered ///< Produced when trying to lock a page-locked memory.
,hipErrorHostMemoryNotRegistered ///< Produced when trying to unlock a non-page-locked memory.
,hipErrorTbd ///< Marker that more error codes are needed.
} hipError_t;
+3 -3
Melihat File
@@ -240,7 +240,7 @@ hipError_t hipHostRegister(void *hostPtr, size_t sizeBytes, unsigned int flags)
hc::AmPointerInfo amPointerInfo(NULL, NULL, 0, acc, 0, 0);
am_status_t am_status = hc::am_memtracker_getinfo(&amPointerInfo, hostPtr);
if(status == AM_SUCCESS){
if(am_status == AM_SUCCESS){
hip_status = hipErrorHostMemoryAlreadyRegistered;
}else{
auto device = ihipGetTlsDefaultDevice();
@@ -266,8 +266,8 @@ hipError_t hipHostRegister(void *hostPtr, size_t sizeBytes, unsigned int flags)
}
return ihipLogStatus(hip_status);
}
}
//---
hipError_t hipHostUnregister(void *hostPtr)
{
HIP_INIT_API(hostPtr);
@@ -278,7 +278,7 @@ hipError_t hipHostUnregister(void *hostPtr)
}else{
am_status_t am_status = hc::am_memory_host_unlock(device->_acc, hostPtr);
if(am_status != AM_SUCCESS){
hip_status = hipErrorInvalidValue;
hip_status = hipErrorHostMemoryNotRegistered;
}
}
return ihipLogStatus(hip_status);
+1 -1
Melihat File
@@ -167,7 +167,7 @@ make_hip_executable (hipHostAlloc hipHostAlloc.cpp)
make_hip_executable (hipStreamL5 hipStreamL5.cpp)
make_hip_executable (hipHostGetFlags hipHostGetFlags.cpp)
#TODO - re-enable. This requires working hipHostRegister call, waiting on HCC feature.
#make_hip_executable (hipHostRegister hipHostRegister.cpp)
make_hip_executable (hipHostRegister hipHostRegister.cpp)
make_hip_executable (hipRandomMemcpyAsync hipRandomMemcpyAsync.cpp)
make_hip_executable (hipMemoryAllocate hipMemoryAllocate.cpp)
make_hip_executable (hipFuncSetDeviceFlags hipFuncSetDeviceFlags.cpp)