diff --git a/hipamd/src/hip_internal.hpp b/hipamd/src/hip_internal.hpp index 08be24d7ae..4c34d5baa7 100644 --- a/hipamd/src/hip_internal.hpp +++ b/hipamd/src/hip_internal.hpp @@ -336,7 +336,10 @@ namespace hip { lastCapturedNodes_.clear(); } for (auto node : graphNodes) { - lastCapturedNodes_.push_back(node); + if (std::find(lastCapturedNodes_.begin(), lastCapturedNodes_.end(), node) == + lastCapturedNodes_.end()) { + lastCapturedNodes_.push_back(node); + } } } /// Set graph that is being captured