From 77f58ceb9faa0452616c4bdfa1b88e6f38526010 Mon Sep 17 00:00:00 2001 From: vstojilj Date: Mon, 1 Dec 2025 11:25:13 +0100 Subject: [PATCH] SWDEV-558557 - Remove duplicate nodes when capturing hipMemcpyAsync (#1226) --- projects/clr/hipamd/src/hip_graph.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/projects/clr/hipamd/src/hip_graph.cpp b/projects/clr/hipamd/src/hip_graph.cpp index 31e07208f1..96ff61dd48 100644 --- a/projects/clr/hipamd/src/hip_graph.cpp +++ b/projects/clr/hipamd/src/hip_graph.cpp @@ -178,6 +178,7 @@ hipError_t ihipGraphAddMemcpyNode1D(hip::GraphNode** pGraphNode, hip::Graph* gra if (status != hipSuccess) { return status; } + *pGraphNode = new hip::GraphMemcpyNode1D(dst, src, count, kind); status = ihipGraphAddNode(*pGraphNode, graph, pDependencies, numDependencies, capture); return status; @@ -759,7 +760,7 @@ hipError_t capturehipMemcpy(hipStream_t stream, void* dst, const void* src, size std::vector pDependencies = s->GetLastCapturedNodes(); size_t numDependencies = s->GetLastCapturedNodes().size(); hip::Graph* graph = s->GetCaptureGraph(); - hip::GraphNode* node = new hip::GraphMemcpyNode1D(dst, src, sizeBytes, kind); + hip::GraphNode* node; hipError_t status = ihipGraphAddMemcpyNode1D(&node, graph, pDependencies.data(), numDependencies, dst, src, sizeBytes, kind, true, s->DeviceId()); if (status != hipSuccess) {