SWDEV-301667 - Selectively queue handler

- Queue handler for hipEventRecord(aka marker_ts_) only if there is a
callback associated with it.

Change-Id: I8a9877ae0e342556053abbaacc9510744a8e772a
This commit is contained in:
Saleel Kudchadker
2022-03-08 14:15:37 -08:00
parent 9292abb2d8
commit 3c3c0ca4c5
6 changed files with 52 additions and 15 deletions
+12
View File
@@ -2631,6 +2631,18 @@ bool Device::IsHwEventReady(const amd::Event& event, bool wait) const {
return WaitForSignal<Timeout>(reinterpret_cast<ProfilingSignal*>(hw_event)->signal_);
}
// ================================================================================================
void Device::getHwEventTime(const amd::Event& event, uint64_t* start, uint64_t* end) const {
void* hw_event = (event.NotifyEvent() != nullptr) ?
event.NotifyEvent()->HwEvent() : event.HwEvent();
if (hw_event == nullptr) {
ClPrint(amd::LOG_INFO, amd::LOG_SIG, "No HW event to read time");
*start = *end = 0;
} else {
fetchSignalTime(reinterpret_cast<ProfilingSignal*>(hw_event)->signal_, getBackendDevice(),
start, end);
}
}
// ================================================================================================
static void callbackQueue(hsa_status_t status, hsa_queue_t* queue, void* data) {
if (status != HSA_STATUS_SUCCESS && status != HSA_STATUS_INFO_BREAK) {