@@ -47,6 +47,7 @@ class HipLoader : protected Loader {
|
||||
typedef decltype(hipRegisterActivityCallback) RegisterActivityCallback_t;
|
||||
typedef decltype(hipRemoveActivityCallback) RemoveActivityCallback_t;
|
||||
typedef decltype(hipKernelNameRef) KernelNameRef_t;
|
||||
typedef decltype(hipApiName) ApiName_t;
|
||||
|
||||
static HipLoader& Instance() {
|
||||
HipLoader* obj = instance_.load(std::memory_order_acquire);
|
||||
@@ -66,6 +67,7 @@ class HipLoader : protected Loader {
|
||||
RegisterActivityCallback = GetFun<RegisterActivityCallback_t>("hipRegisterActivityCallback");
|
||||
RemoveActivityCallback = GetFun<RemoveActivityCallback_t>("hipRemoveActivityCallback");
|
||||
KernelNameRef = GetFun<KernelNameRef_t>("hipKernelNameRef");
|
||||
ApiName = GetFun<ApiName_t>("hipApiName");
|
||||
}
|
||||
|
||||
RegisterApiCallback_t* RegisterApiCallback;
|
||||
@@ -73,6 +75,7 @@ class HipLoader : protected Loader {
|
||||
RegisterActivityCallback_t* RegisterActivityCallback;
|
||||
RemoveActivityCallback_t* RemoveActivityCallback;
|
||||
KernelNameRef_t* KernelNameRef;
|
||||
ApiName_t* ApiName;
|
||||
|
||||
private:
|
||||
static std::atomic<HipLoader*> instance_;
|
||||
|
||||
@@ -598,7 +598,7 @@ PUBLIC_API const char* roctracer_op_string(
|
||||
break;
|
||||
}
|
||||
case ACTIVITY_DOMAIN_HIP_API: {
|
||||
return hipApiName(op);
|
||||
return roctracer::HipLoader::Instance().ApiName(op);
|
||||
break;
|
||||
}
|
||||
default:
|
||||
|
||||
@@ -196,7 +196,7 @@ void hip_api_flush_cb(hip_api_trace_entry_t* entry) {
|
||||
std::ostringstream oss; \
|
||||
|
||||
oss << std::dec <<
|
||||
begin_timestamp << ":" << end_timestamp << " " << entry->pid << ":" << entry->tid << " " << roctracer_op_string(ACTIVITY_DOMAIN_HIP_API, cid, 0); \
|
||||
begin_timestamp << ":" << end_timestamp << " " << entry->pid << ":" << entry->tid << " " << roctracer_op_string(ACTIVITY_DOMAIN_HIP_API, cid, 0);
|
||||
|
||||
switch (cid) {
|
||||
case HIP_API_ID_hipMemcpy:
|
||||
@@ -244,6 +244,7 @@ void hcc_activity_callback(const char* begin, const char* end, void* arg) {
|
||||
if (record->domain == ACTIVITY_DOMAIN_HCC_OPS) {
|
||||
fprintf(hcc_activity_file_handle, "%lu:%lu %d:%lu %s:%lu\n",
|
||||
record->begin_ns, record->end_ns, record->device_id, record->queue_id, name, record->correlation_id);
|
||||
fflush(hcc_activity_file_handle);
|
||||
} else {
|
||||
#if 0
|
||||
fprintf(hip_api_file_handle, "%lu:%lu %u:%u %s()\n",
|
||||
|
||||
Ссылка в новой задаче
Block a user