SWDEV-439581 - hipEventBlockingSync flag for hip events

Change-Id: I0d7785a568f8007f82f999776a7ad23d0acc81b7


[ROCm/clr commit: a5a4b78606]
This commit is contained in:
Ajay
2024-02-28 06:17:26 -08:00
committed by Maneesh Gupta
parent 24a3ca5f94
commit cea4f4290a
5 changed files with 17 additions and 9 deletions
@@ -2924,14 +2924,16 @@ bool Device::IsHwEventReadyForcedWait(const amd::Event& event) const {
}
// ================================================================================================
bool Device::IsHwEventReady(const amd::Event& event, bool wait) const {
bool Device::IsHwEventReady(const amd::Event& event, bool wait, int hip_event_flags) 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");
return false;
} else if (wait) {
return WaitForSignal(reinterpret_cast<ProfilingSignal*>(hw_event)->signal_, ActiveWait());
constexpr int kHipEventBlockingSync = 0x1;
bool active_wait = !(hip_event_flags & kHipEventBlockingSync) && ActiveWait();
return WaitForSignal(reinterpret_cast<ProfilingSignal*>(hw_event)->signal_, active_wait);
}
return (hsa_signal_load_relaxed(reinterpret_cast<ProfilingSignal*>(hw_event)->signal_) == 0);
}