using hipApiString() if defined
This commit is contained in:
@@ -24,6 +24,15 @@ THE SOFTWARE.
|
||||
#define INC_ROCTRACER_HIP_H_
|
||||
|
||||
#include <hip/hip_runtime.h>
|
||||
|
||||
namespace hip_hidden_namespace {
|
||||
#include <hip/hcc_detail/hip_prof_str.h>
|
||||
}; // 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 <hip/hcc_detail/hip_prof_str.h>
|
||||
|
||||
#include "roctracer.h"
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user