From 09b894eeef37ffe7e8a01ffb7d91b8b070774589 Mon Sep 17 00:00:00 2001 From: Anusha GodavarthySurya Date: Tue, 13 Dec 2022 05:08:25 +0000 Subject: [PATCH] SWDEV-325711 - Node can be enabled/disabled only for kernel, memcpy and memset nodes Change-Id: Id9c19a14655732d61fccee9c3d1ffa0614123468 [ROCm/clr commit: 0fcc5557bd982ed004825c938198400b50cf3580] --- .../clr/hipamd/src/hip_graph_internal.hpp | 27 +++++++++---------- 1 file changed, 13 insertions(+), 14 deletions(-) diff --git a/projects/clr/hipamd/src/hip_graph_internal.hpp b/projects/clr/hipamd/src/hip_graph_internal.hpp index a70bb88f1d..8f0d6b9bcf 100644 --- a/projects/clr/hipamd/src/hip_graph_internal.hpp +++ b/projects/clr/hipamd/src/hip_graph_internal.hpp @@ -327,20 +327,19 @@ struct hipGraphNode : public hipGraphNodeDOTAttribute { virtual void EnqueueCommands(hipStream_t stream) { // If the node is disabled it becomes empty node. To maintain ordering just enqueue marker. // Node can be enabled/disabled only for kernel, memcpy and memset nodes. - if (isEnabled_) { - for (auto& command : commands_) { - command->enqueue(); - command->release(); - } - } else { - if (type_ == hipGraphNodeTypeKernel || type_ == hipGraphNodeTypeMemcpy || - type_ == hipGraphNodeTypeMemset) { - amd::Command::EventWaitList waitList; - amd::HostQueue* queue = hip::getQueue(stream); - amd::Command* command = new amd::Marker(*queue, !kMarkerDisableFlush, waitList); - command->enqueue(); - command->release(); - } + if (!isEnabled_ && + (type_ == hipGraphNodeTypeKernel || type_ == hipGraphNodeTypeMemcpy || + type_ == hipGraphNodeTypeMemset)) { + amd::Command::EventWaitList waitList; + amd::HostQueue* queue = hip::getQueue(stream); + amd::Command* command = new amd::Marker(*queue, !kMarkerDisableFlush, waitList); + command->enqueue(); + command->release(); + return; + } + for (auto& command : commands_) { + command->enqueue(); + command->release(); } } ihipGraph* GetParentGraph() { return parentGraph_; }