SWDEV-443567 - SWDEV-436126 - Fix Prohibited and Unhandled Operations during capture
=> hipDeviceSynchronize is not allowed during capture.
=> hipEventSynchronize during capture should return hipErrorCapturedEvent error
=> hipEventQuery during capture should return hipErrorCapturedEvent error
hipStreamSynchronize, hipEventSynchronize, hipStreamWaitEvent, hipStreamQuery
For Side Stream(Stream that is not currently under capture):
=> If current thread is capturing in relaxed mode, calls are allowed
=> If any stream in current/concurrent thread is capturing in global mode, calls are not allowed
=> If any stream in current thread is capturing in ThreadLocal mode, calls are not allowed
For Stream that is currently under capture
=> calls are not allowed
=> Any call that is not allowed during capture invalidates the capture sequence
=> It is invalid to call synchronous APIs during capture. Synchronous APIs,
such as hipMemcpy(), enqueue work to the legacy stream and synchronize it before returning.
Change-Id: I201c6e63e1a5d93fd416a3b520264c0fdbe31237
[ROCm/clr commit: 19b4660cbb]
이 커밋은 다음에 포함됨:
1 부모
4f123e9c10
커밋
ae296c8fad
5 파일이 변경됨
+72
-24
검색과 일치하는 파일 없음
@@ -961,7 +961,7 @@ hipError_t hipStreamEndCapture_common(hipStream_t stream, hip::Graph** pGraph) {
|
||||
if (s->GetCaptureStatus() == hipStreamCaptureStatusNone) {
|
||||
return hipErrorIllegalState;
|
||||
}
|
||||
// Capture must be ended on the same stream in which it was initiated
|
||||
// Capture must be ended on the same stream in which it was initiated
|
||||
if (!s->IsOriginStream()) {
|
||||
return hipErrorStreamCaptureUnmatched;
|
||||
}
|
||||
@@ -978,15 +978,17 @@ hipError_t hipStreamEndCapture_common(hipStream_t stream, hip::Graph** pGraph) {
|
||||
amd::ScopedLock lock(g_captureStreamsLock);
|
||||
g_captureStreams.erase(std::find(g_captureStreams.begin(), g_captureStreams.end(), s));
|
||||
}
|
||||
{
|
||||
amd::ScopedLock lock(g_streamSetLock);
|
||||
g_allCapturingStreams.erase(
|
||||
std::find(g_allCapturingStreams.begin(), g_allCapturingStreams.end(), s));
|
||||
}
|
||||
// If capture was invalidated, due to a violation of the rules of stream capture
|
||||
if (s->GetCaptureStatus() == hipStreamCaptureStatusInvalidated) {
|
||||
*pGraph = nullptr;
|
||||
return hipErrorStreamCaptureInvalidated;
|
||||
}
|
||||
{
|
||||
amd::ScopedLock lock(g_streamSetLock);
|
||||
g_allCapturingStreams.erase(std::find(g_allCapturingStreams.begin(), g_allCapturingStreams.end(), s));
|
||||
}
|
||||
|
||||
// check if all parallel streams have joined
|
||||
// Nodes that are removed from the dependency set via API hipStreamUpdateCaptureDependencies do
|
||||
// not result in hipErrorStreamCaptureUnjoined
|
||||
|
||||
새 이슈에서 참조
사용자 차단