SWDEV-351980 - Move hip_api_data and record to the HIP function's stack
Since the hip_api_data and record are only needed at the HIP function's
scope, there is no need to allocate/free them in the ROCtracer activity
callback, they can reside on the HIP function's stack frame.
This solves an issue with the thread local stacks of records the tracer
maintains that are destroyed first (before any global destructor) on
process exit, making it impossible to use HIP functions in global
destructors when the profiler is enabled.
Change-Id: Ib1d70124d009a44dc1f08d41edff95e5f9f84369
[ROCm/clr commit: 85fd969253]
Αυτή η υποβολή περιλαμβάνεται σε:
υποβλήθηκε από
Maneesh Gupta
γονέας
c328f3b15f
υποβολή
472b3f3155
@@ -20,16 +20,15 @@
|
||||
|
||||
#include "platform/activity.hpp"
|
||||
|
||||
extern "C" void hipInitActivityCallback(void* id_callback, void* op_callback, void* arg) {
|
||||
activity_prof::CallbacksTable::init(reinterpret_cast<activity_prof::id_callback_fun_t>(id_callback),
|
||||
reinterpret_cast<activity_prof::callback_fun_t>(op_callback),
|
||||
extern "C" void hipInitActivityCallback(void* op_callback, void* arg) {
|
||||
activity_prof::CallbacksTable::init(reinterpret_cast<activity_async_callback_t>(op_callback),
|
||||
arg);
|
||||
}
|
||||
|
||||
extern "C" bool hipEnableActivityCallback(unsigned op, bool enable) {
|
||||
return activity_prof::CallbacksTable::SetEnabled(op, enable);
|
||||
return activity_prof::CallbacksTable::setEnabled(static_cast<OpId>(op), enable);
|
||||
}
|
||||
|
||||
extern "C" const char* hipGetCmdName(unsigned op) {
|
||||
return getOclCommandKindString(static_cast<uint32_t>(op));
|
||||
return getOclCommandKindString(static_cast<cl_command_type>(op));
|
||||
}
|
||||
|
||||
Αναφορά σε νέο ζήτημα
Block a user