SWDEV-490864 - Optimize Alloc Node detection in graph

Change-Id: I6ac32f9abd0b44864071a0a9396463cb13f6941f


[ROCm/clr commit: 314d4a2c22]
This commit is contained in:
Rahul Manocha
2024-10-14 10:44:28 -07:00
committed by Rahul Manocha
parent 04628d2d1f
commit 5b40eefdac
2 changed files with 10 additions and 11 deletions
@@ -837,13 +837,10 @@ hipError_t GraphExec::Run(hipStream_t graph_launch_stream) {
// If this is a repeat launch, make sure corresponding MemFreeNode exists for a MemAlloc node
if (repeatLaunch_ == true) {
for (auto& node : topoOrder_) {
if (node->GetType() == hipGraphNodeTypeMemAlloc &&
static_cast<GraphMemAllocNode*>(node)->IsActiveMem() == true) {
return hipErrorInvalidValue;
}
if (topoOrder_[0]->GetParentGraph()->GetMemAllocNodeCount() > 0) {
return hipErrorInvalidValue;
}
} else {
} else {
repeatLaunch_ = true;
}