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 committed 2017-10-30 20:20:51 +00:00
1 parent fd5b9cb650
commit 4df6b371ab
5 files changed
+30 -17

No files matched your search

+6 -2
View File
@@ -156,7 +156,7 @@ thread_local TidInfo tls_tidInfo;
//=================================================================================================
// Top-level "free" functions:
//=================================================================================================
void recordApiTrace(std::string *fullStr, const std::string &apiStr)
uint64_t recordApiTrace(std::string *fullStr, const std::string &apiStr)
{
auto apiSeqNum = tls_tidInfo.apiSeqNum();
auto tid = tls_tidInfo.tid();
@@ -178,10 +178,14 @@ void recordApiTrace(std::string *fullStr, const std::string &apiStr)
*fullStr += " ";
*fullStr += apiStr;
uint64_t apiStartTick = getTicks();
if (COMPILE_HIP_DB && HIP_TRACE_API) {
fprintf (stderr, "%s<<hip-api tid:%s%s\n" , API_COLOR, fullStr->c_str(), API_COLOR_END);
fprintf (stderr, "%s<<hip-api tid:%s @%lu%s\n" , API_COLOR, fullStr->c_str(), apiStartTick, API_COLOR_END);
}
return apiStartTick;
}