diff --git a/inc/roctracer_hip.h b/inc/roctracer_hip.h index 28e4868d59..83ec145089 100644 --- a/inc/roctracer_hip.h +++ b/inc/roctracer_hip.h @@ -24,6 +24,15 @@ THE SOFTWARE. #define INC_ROCTRACER_HIP_H_ #include + +namespace hip_hidden_namespace { +#include +}; // namespace hip_hidden_namespace +#if HIP_PROF_VER >= 1 +#define HIP_PROF_HIP_API_STRING 1 +#endif +#undef HIP_PROF_VER +#undef _HIP_PROF_STR_H #include #include "roctracer.h" diff --git a/test/tool/tracer_tool.cpp b/test/tool/tracer_tool.cpp index 89960aad94..d7e80d01d4 100644 --- a/test/tool/tracer_tool.cpp +++ b/test/tool/tracer_tool.cpp @@ -406,6 +406,10 @@ void hip_api_flush_cb(hip_api_trace_entry_t* entry) { begin_timestamp << ":" << end_timestamp << " " << entry->pid << ":" << entry->tid << " " << str; if (domain == ACTIVITY_DOMAIN_HIP_API) { +#if HIP_PROF_HIP_API_STRING + const char* str = hipApiString(cid, data); + fprintf(hip_api_file_handle, "%s\n", str); +#else // !HIP_PROF_HIP_API_STRING switch (cid) { case HIP_API_ID_hipMemcpy: fprintf(hip_api_file_handle, "%s",oss.str().c_str()); @@ -459,6 +463,7 @@ void hip_api_flush_cb(hip_api_trace_entry_t* entry) { default: fprintf(hip_api_file_handle, "%s()\n", oss.str().c_str()); } +#endif // !HIP_PROF_HIP_API_STRING } else { fprintf(hip_api_file_handle, "%s(name(%s))\n", oss.str().c_str(), entry->name); }