Skip to content

Commit 036b3c9

Browse files
bweltonTudor, Alexandru
authored andcommitted
rocr: Reset event_age when signals move
Resets event_age when signals move. Prior to this PR, event_age can become unaligned with hsa_event, causing hangs if the event_age exceeds the true hsa_event age.
1 parent 54b9ead commit 036b3c9

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

runtime/hsa-runtime/core/runtime/runtime.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1582,13 +1582,13 @@ void Runtime::AsyncEventsLoop(void* _eventsInfo) {
15821582
if (hsa_events.size() <= unique_evts) {
15831583
hsa_events.resize(unique_evts + 10);
15841584
event_age.resize(unique_evts + 10);
1585-
}
1586-
hsa_events[unique_evts] = hsa_event;
1587-
if (init_age) {
1588-
event_age[unique_evts] = runtime_singleton_->KfdVersion().supports_event_age ? 1 : 0;
1589-
}
1590-
unique_evts++;
1591-
return true;
1585+
}
1586+
if (init_age || hsa_events[unique_evts] != hsa_event ) {
1587+
event_age[unique_evts] = runtime_singleton_->KfdVersion().supports_event_age ? 1 : 0;
1588+
}
1589+
hsa_events[unique_evts] = hsa_event;
1590+
unique_evts++;
1591+
return true;
15921592
}
15931593
};
15941594

0 commit comments

Comments
 (0)