SWDEV-374368 - dependency list should not have duplicate
Signed-off-by: sdashmiz <shadi.dashmiz@amd.com> Change-Id: I67e1c8203f10916b98408e2004e6c64e96b1933b
Este commit está contenido en:
@@ -36,11 +36,16 @@ inline hipError_t ihipGraphAddNode(hipGraphNode_t graphNode, hipGraph_t graph,
|
||||
const hipGraphNode_t* pDependencies, size_t numDependencies,
|
||||
bool capture = true) {
|
||||
graph->AddNode(graphNode);
|
||||
std::unordered_set<hipGraphNode_t> DuplicateDep;
|
||||
for (size_t i = 0; i < numDependencies; i++) {
|
||||
if ((!hipGraphNode::isNodeValid(pDependencies[i])) ||
|
||||
(graph != pDependencies[i]->GetParentGraph())) {
|
||||
return hipErrorInvalidValue;
|
||||
}
|
||||
if (DuplicateDep.find(pDependencies[i]) != DuplicateDep.end()) {
|
||||
return hipErrorInvalidValue;
|
||||
}
|
||||
DuplicateDep.insert(pDependencies[i]);
|
||||
pDependencies[i]->AddEdge(graphNode);
|
||||
}
|
||||
if (capture == false) {
|
||||
|
||||
Referencia en una nueva incidencia
Block a user