SWDEV-489823 - Fix hipStreamEndCapture leak when capture is invalidated

Change-Id: If8f5163d70e04d34a75fd0a7ba6c0a15ea59bb8b
Tento commit je obsažen v:
Vladana Stojiljkovic
2024-10-07 17:22:15 +02:00
rodič 5ccc140e1b
revize 6f2bad3998
2 změnil soubory, kde provedl 7 přidání a 0 odebrání
+5
Zobrazit soubor
@@ -1016,6 +1016,11 @@ hipError_t hipStreamEndCapture_common(hipStream_t stream, hip::Graph** pGraph) {
// If capture was invalidated, due to a violation of the rules of stream capture
if (s->GetCaptureStatus() == hipStreamCaptureStatusInvalidated) {
*pGraph = nullptr;
// When capture is invalidated, graph should be deleted, otherwise it leaks
hip::Graph* graph = s->GetCaptureGraph();
delete graph;
s->ResetCaptureGraph();
return hipErrorStreamCaptureInvalidated;
}