From d347f1d67d92b9a13c025703a14d68ea448474dd Mon Sep 17 00:00:00 2001 From: Anusha GodavarthySurya Date: Mon, 4 Dec 2023 07:09:31 +0000 Subject: [PATCH] SWDEV-351966 - Remove hipRegisterTracerCallback from dispatch table Change-Id: Ib343e2c8414a98c0cee6c60fb74a47bb859d8f45 --- hipamd/include/hip/amd_detail/hip_api_trace.hpp | 3 --- hipamd/src/hip_api_trace.cpp | 2 -- hipamd/src/hip_intercept.cpp | 12 +++++------- hipamd/src/hip_table_interface.cpp | 3 --- 4 files changed, 5 insertions(+), 15 deletions(-) diff --git a/hipamd/include/hip/amd_detail/hip_api_trace.hpp b/hipamd/include/hip/amd_detail/hip_api_trace.hpp index 06c41f933f..ba0288c02f 100644 --- a/hipamd/include/hip/amd_detail/hip_api_trace.hpp +++ b/hipamd/include/hip/amd_detail/hip_api_trace.hpp @@ -634,8 +634,6 @@ typedef hipError_t (*t_hipPointerSetAttribute)(const void* value, hipPointer_att hipDeviceptr_t ptr); typedef hipError_t (*t_hipProfilerStart)(); typedef hipError_t (*t_hipProfilerStop)(); -typedef void (*t_hipRegisterTracerCallback)(const void* function); -typedef void (*t_hipRegisterTracerId)(uint64_t id); typedef hipError_t (*t_hipRuntimeGetVersion)(int* runtimeVersion); typedef hipError_t (*t_hipSetDevice)(int deviceId); typedef hipError_t (*t_hipSetDeviceFlags)(unsigned flags); @@ -1212,7 +1210,6 @@ struct HipDispatchTable { t_hipPointerSetAttribute hipPointerSetAttribute_fn; t_hipProfilerStart hipProfilerStart_fn; t_hipProfilerStop hipProfilerStop_fn; - t_hipRegisterTracerCallback hipRegisterTracerCallback_fn; t_hipRuntimeGetVersion hipRuntimeGetVersion_fn; t_hipSetDevice hipSetDevice_fn; t_hipSetDeviceFlags hipSetDeviceFlags_fn; diff --git a/hipamd/src/hip_api_trace.cpp b/hipamd/src/hip_api_trace.cpp index b77dad3f56..8394a0676e 100644 --- a/hipamd/src/hip_api_trace.cpp +++ b/hipamd/src/hip_api_trace.cpp @@ -534,7 +534,6 @@ hipError_t hipPointerSetAttribute(const void* value, hipPointer_attribute attrib hipDeviceptr_t ptr); hipError_t hipProfilerStart(); hipError_t hipProfilerStop(); -void hipRegisterTracerCallback(const void* function); hipError_t hipRuntimeGetVersion(int* runtimeVersion); hipError_t hipSetDevice(int deviceId); hipError_t hipSetDeviceFlags(unsigned flags); @@ -1091,7 +1090,6 @@ void UpdateHipDispatchTable(HipDispatchTable* ptrDispatchTable) { ptrDispatchTable->hipPointerSetAttribute_fn = hip::hipPointerSetAttribute; ptrDispatchTable->hipProfilerStart_fn = hip::hipProfilerStart; ptrDispatchTable->hipProfilerStop_fn = hip::hipProfilerStop; - ptrDispatchTable->hipRegisterTracerCallback_fn = hip::hipRegisterTracerCallback; ptrDispatchTable->hipRuntimeGetVersion_fn = hip::hipRuntimeGetVersion; ptrDispatchTable->hipSetDevice_fn = hip::hipSetDevice; ptrDispatchTable->hipSetDeviceFlags_fn = hip::hipSetDeviceFlags; diff --git a/hipamd/src/hip_intercept.cpp b/hipamd/src/hip_intercept.cpp index 637c90640c..bac8e40caf 100644 --- a/hipamd/src/hip_intercept.cpp +++ b/hipamd/src/hip_intercept.cpp @@ -45,13 +45,11 @@ const char* hipKernelNameRefByPtr(const void* host_function, hipStream_t stream) return (host_function != nullptr) ? PlatformState::instance().getStatFuncName(host_function) : nullptr; } - -void hipRegisterTracerCallback(const void* function) { - typedef int (*fptr)(activity_domain_t domain, uint32_t operation_id, void* data); - fptr my_fptr = reinterpret_cast(const_cast(function)); - activity_prof::report_activity.store(my_fptr, std::memory_order_relaxed); -} - const char* hipApiName(uint32_t id) { return hip_api_name(id); } } // namespace hip + +extern "C" void hipRegisterTracerCallback(int (*function)(activity_domain_t domain, + uint32_t operation_id, void* data)) { + activity_prof::report_activity.store(function, std::memory_order_relaxed); +} diff --git a/hipamd/src/hip_table_interface.cpp b/hipamd/src/hip_table_interface.cpp index 72ebff234d..22065cc9aa 100644 --- a/hipamd/src/hip_table_interface.cpp +++ b/hipamd/src/hip_table_interface.cpp @@ -1280,9 +1280,6 @@ hipError_t hipPointerSetAttribute(const void* value, hipPointer_attribute attrib } hipError_t hipProfilerStart() { return hip::GetHipDispatchTable()->hipProfilerStart_fn(); } hipError_t hipProfilerStop() { return hip::GetHipDispatchTable()->hipProfilerStop_fn(); } -extern "C" void hipRegisterTracerCallback(const void* function) { - return hip::GetHipDispatchTable()->hipRegisterTracerCallback_fn(function); -} hipError_t hipRuntimeGetVersion(int* runtimeVersion) { return hip::GetHipDispatchTable()->hipRuntimeGetVersion_fn(runtimeVersion); }