SWDEV-360031 - Correct APIs behaviour

- correct error for hipStreamWaitEvent when event recorded before
  capture
- correct hipEventSync when event is synced during capture

Signed-off-by: sdashmiz <shadi.dashmiz@amd.com>
Change-Id: I7ecbed5621eaf323846d4ccb20ec112aaa8a5757
This commit is contained in:
sdashmiz
2023-02-22 16:16:13 -05:00
committed by Shadi Dashmiz
parent d9c00767dc
commit 544318fffe
2 changed files with 24 additions and 3 deletions
+8
View File
@@ -522,6 +522,14 @@ hipError_t hipStreamWaitEvent_common(hipStream_t stream, hipEvent_t event, unsig
}
hip::Event* e = reinterpret_cast<hip::Event*>(event);
if ((e->GetCaptureStream() != nullptr) &&
(reinterpret_cast<hip::Stream*>(e->GetCaptureStream())->GetCaptureStatus()
== hipStreamCaptureStatusActive)) {
// If stream is capturing but event is not recorded on event's stream.
if (e->GetCaptureStatus() == false) {
return hipErrorStreamCaptureIsolation;
}
}
return e->streamWait(stream, flags);
}