SWDEV-351980 - Consolidate registration tables in the roctracer library

Remove the api_callbacks_table_t that was holding the API activities and
user callbacks. Instead use a single roctracer callback (TracerCallback)
used to report both API activities and callbacks.

Remove the hipInitActivityCallback that was setting the ROCtracer
callback and memory pool for asynchronous activities as it did not
allow disctinct pools to be used for each activity.  Instead, use
hipRegisterTracerCallback to set the single roctracer callback.

Change-Id: I4c10f04f29a6e4cce8caf15db3016c3f72c86b04
This commit is contained in:
Laurent Morichetti
2022-08-30 17:55:43 -07:00
committed by Maneesh Gupta
szülő eeddffc1b1
commit 82bce811ee
8 fájl változott, egészen pontosan 57 új sor hozzáadva és 170 régi sor törölve
+1 -10
Fájl megtekintése
@@ -24,8 +24,6 @@
#include "thread/monitor.hpp"
#include "hip_prof_api.h"
extern api_callbacks_table_t callbacks_table;
static amd::Monitor streamSetLock{"Guards global stream set"};
static std::unordered_set<hip::Stream*> streamSet;
namespace hip {
@@ -77,12 +75,6 @@ hipError_t Stream::EndCapture() {
}
// ================================================================================================
bool Stream::Create() {
// Enable queue profiling if a profiler is attached which sets the callback_table flag
// or if we force it with env var. This would enable time stamp collection for every
// command submitted to the stream(queue).
bool isProfilerAttached = callbacks_table.is_enabled();
cl_command_queue_properties properties = isProfilerAttached ?
CL_QUEUE_PROFILING_ENABLE : 0;
amd::CommandQueue::Priority p;
switch (priority_) {
case Priority::High:
@@ -97,7 +89,7 @@ bool Stream::Create() {
break;
}
amd::HostQueue* queue = new amd::HostQueue(*device_->asContext(), *device_->devices()[0],
properties, amd::CommandQueue::RealTimeDisabled,
0, amd::CommandQueue::RealTimeDisabled,
p, cuMask_);
// Create a host queue
@@ -107,7 +99,6 @@ bool Stream::Create() {
amd::ScopedLock lock(streamSetLock);
streamSet.insert(this);
queue_ = queue;
queue->vdev()->profilerAttach(isProfilerAttached);
device_->SaveQueue(queue);
} else if (queue != nullptr) {
// Queue creation has failed, and virtual device associated with the queue may not be created.