Skip to content

Commit 73ac21e

Browse files
committed
Fix Unit_hipStreamBeginCaptureToGraph_CapturePartialInThreads
1 parent ae29018 commit 73ac21e

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

projects/clr/hipamd/src/hip_event.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -396,6 +396,13 @@ hipError_t hipEventRecord_common(hipEvent_t event, hipStream_t stream, unsigned
396396
hip::Event* e = reinterpret_cast<hip::Event*>(event);
397397
hip::Stream* s = reinterpret_cast<hip::Stream*>(stream);
398398
hip::Stream* hip_stream = hip::getStream(stream);
399+
if (hipStream_t lastCaptureStream = e->GetCaptureStream()) {
400+
if (hip::isValid(lastCaptureStream)) {
401+
if ((lastCaptureStream != nullptr) && (lastCaptureStream != hipStreamLegacy)) {
402+
reinterpret_cast<hip::Stream*>(e->GetCaptureStream())->EraseCaptureEvent(event);
403+
}
404+
}
405+
}
399406
e->SetCaptureStream(stream);
400407
if ((stream != nullptr && stream != hipStreamLegacy) &&
401408
(s->GetCaptureStatus() == hipStreamCaptureStatusActive)) {

0 commit comments

Comments
 (0)