Add ns-level timer for HIP API routines

Refactor some miuses of ihipLogStatus, these should only be in top-level
HIP APIs and should be paired with HIP_API_INIT calls.


[ROCm/clr commit: dc7d993a02]
This commit is contained in:
Ben Sander
2017-10-30 20:18:41 +00:00
parent fd5b9cb650
commit 4df6b371ab
5 changed files with 30 additions and 17 deletions
+5 -5
View File
@@ -60,12 +60,12 @@ hipError_t ihipGetDeviceCount(int *count)
*count = g_deviceCnt;
if (*count > 0) {
e = ihipLogStatus(hipSuccess);
e = hipSuccess;
} else {
e = ihipLogStatus(hipErrorNoDevice);
e = hipErrorNoDevice;
}
} else {
e = ihipLogStatus(hipErrorInvalidValue);
e = hipErrorInvalidValue;
}
return e;
}
@@ -73,7 +73,7 @@ hipError_t ihipGetDeviceCount(int *count)
hipError_t hipGetDeviceCount(int *count)
{
HIP_INIT_API(count);
return ihipGetDeviceCount(count);
return ihipLogStatus(ihipGetDeviceCount(count));
}
hipError_t hipDeviceSetCacheConfig(hipFuncCache_t cacheConfig)
@@ -205,7 +205,7 @@ hipError_t ihipDeviceGetAttribute(int* pi, hipDeviceAttribute_t attr, int device
hipError_t e = hipSuccess;
if(pi == nullptr) {
return ihipLogStatus(hipErrorInvalidValue);
return hipErrorInvalidValue;
}
auto * hipDevice = ihipGetDevice(device);