SWDEV-516994 - Fix race condition in the implementation of graph AutoFreeOnLaunch on Windows

Change-Id: I3c98d0d4bffe2a9e0aa5cfa24b6c8e9a8087da29


[ROCm/clr commit: a8f309049d]
Tento commit je obsažen v:
Ioannis Assiouras
2025-02-25 12:56:21 +00:00
rodič 75d53e5c22
revize eb825325d2
+6
Zobrazit soubor
@@ -691,6 +691,12 @@ hipError_t GraphExec::Run(hipStream_t graph_launch_stream) {
if (!topoOrder_.empty()) {
topoOrder_[0]->GetParentGraph()->FreeAllMemory(launch_stream);
topoOrder_[0]->GetParentGraph()->memalloc_nodes_ = 0;
if (!AMD_DIRECT_DISPATCH) {
// The MemoryPool::FreeAllMemory queues a memory unmap command that for !AMD_DIRECT_DISPATCH
// runs asynchonously. Make sure that freeAllMemory is complete before creating new commands
// to prevent races to the MemObjMap.
launch_stream->finish();
}
}
}