kfdtest: Add event-based synchronization mechanism to queues

Wait4PacketConsumption now can accept an event to wait all packets subbmitted
to be processed.

Change-Id: I1497b7704e892b04d05811b8d3e4742237c1be57
Signed-off-by: xinhui pan <xinhui.pan@amd.com>


[ROCm/ROCR-Runtime commit: 9c7cfc0df2]
This commit is contained in:
xinhui pan
2018-08-27 14:56:48 +08:00
committed by Xinhui Pan
parent 094073ff74
commit 718af9febc
6 changed files with 44 additions and 2 deletions
@@ -71,3 +71,15 @@ void PM4Queue::SubmitPacket() {
}
}
void PM4Queue::Wait4PacketConsumption(HsaEvent *event) {
if (event) {
PlaceAndSubmitPacket(PM4ReleaseMemoryPacket(0,
event->EventData.HWData2,
event->EventId,
true));
EXPECT_SUCCESS(hsaKmtWaitOnEvent(event, g_TestTimeOut));
} else {
BaseQueue::Wait4PacketConsumption();
}
}