hipLaunchKernel kernel name fix

Change-Id: I59c63ec34f77fe39ed1edc8b6395db3871004e40


[ROCm/roctracer commit: 511f659a8e]
Este commit está contenido en:
Evgeny
2020-05-28 10:07:50 -05:00
cometido por Evgeny Shcherbakov
padre 691d8c1809
commit 802ee7dee6
Se han modificado 2 ficheros con 11 adiciones y 4 borrados
+3
Ver fichero
@@ -114,6 +114,7 @@ class HipApi {
typedef decltype(hipRegisterActivityCallback) RegisterActivityCallback_t;
typedef decltype(hipRemoveActivityCallback) RemoveActivityCallback_t;
typedef decltype(hipKernelNameRef) KernelNameRef_t;
typedef decltype(hipKernelNameRefByPtr) KernelNameRefByPtr_t;
typedef decltype(hipApiName) ApiName_t;
RegisterApiCallback_t* RegisterApiCallback;
@@ -121,6 +122,7 @@ class HipApi {
RegisterActivityCallback_t* RegisterActivityCallback;
RemoveActivityCallback_t* RemoveActivityCallback;
KernelNameRef_t* KernelNameRef;
KernelNameRefByPtr_t* KernelNameRefByPtr;
ApiName_t* ApiName;
protected:
@@ -130,6 +132,7 @@ class HipApi {
RegisterActivityCallback = loader->GetFun<RegisterActivityCallback_t>("hipRegisterActivityCallback");
RemoveActivityCallback = loader->GetFun<RemoveActivityCallback_t>("hipRemoveActivityCallback");
KernelNameRef = loader->GetFun<KernelNameRef_t>("hipKernelNameRef");
KernelNameRefByPtr = loader->GetFun<KernelNameRefByPtr_t>("hipKernelNameRefByPtr");
ApiName = loader->GetFun<ApiName_t>("hipApiName");
}
};
+8 -4
Ver fichero
@@ -347,11 +347,11 @@ roctracer::TraceBuffer<hip_api_trace_entry_t> hip_api_trace_buffer("HIP", 0x2000
static inline bool is_hip_kernel_launch_api(const uint32_t& cid) {
bool ret =
#if 0 // HIP_VDI
(cid == HIP_API_ID_hipLaunchKernel) ||
(cid == HIP_API_ID_hipExtLaunchMultiKernelMultiDevice) ||
(cid == HIP_API_ID_hipLaunchCooperativeKernel) ||
(cid == HIP_API_ID_hipLaunchCooperativeKernelMultiDevice) ||
#endif
(cid == HIP_API_ID_hipLaunchKernel) ||
(cid == HIP_API_ID_hipModuleLaunchKernel) ||
(cid == HIP_API_ID_hipExtModuleLaunchKernel) ||
(cid == HIP_API_ID_hipHccModuleLaunchKernel);
@@ -387,9 +387,13 @@ void hip_api_callback(
if (cid == HIP_API_ID_hipMalloc) {
entry->ptr = *(data->args.hipMalloc.ptr);
} else if (is_hip_kernel_launch_api(cid)) {
const hipFunction_t f = data->args.hipModuleLaunchKernel.f;
if (f != NULL) {
entry->name = strdup(roctracer::HipLoader::Instance().KernelNameRef(f));
if (cid == HIP_API_ID_hipLaunchKernel) {
const void* f = data->args.hipLaunchKernel.function_address;
hipStream_t stream = data->args.hipLaunchKernel.stream;
if (f != NULL) entry->name = strdup(roctracer::HipLoader::Instance().KernelNameRefByPtr(f, stream));
} else {
const hipFunction_t f = data->args.hipModuleLaunchKernel.f;
if (f != NULL) entry->name = strdup(roctracer::HipLoader::Instance().KernelNameRef(f));
}
}
}