SWDEV-316819 - adding graph checks

hipGraphChildGraphNodeGetGraph - Scenario 3: Pass Parent node instead of the child node

Change-Id: Ia55921bca1e2745c9c97f2b7eb36244ffb719eb4


[ROCm/clr commit: 5dd91d698b]
Cette révision appartient à :
Payam a créé et Payam Ghafari a révisé 2022-03-14 22:43:58 -04:00
1 Parent bc59991924
révision eff4583118
2 fichiers modifiés
+4 -1

Aucun fichier ne correspond à votre recherche

+3 -1
Voir le fichier
@@ -1200,7 +1200,9 @@ hipError_t hipGraphChildGraphNodeGetGraph(hipGraphNode_t node, hipGraph_t* pGrap
HIP_RETURN(hipErrorInvalidValue);
}
*pGraph = reinterpret_cast<hipChildGraphNode*>(node)->GetChildGraph();
if (pGraph == nullptr) {
//if the node count is larger than 0, the current node is a parent
if (*pGraph == nullptr || reinterpret_cast<ihipGraph*>(pGraph)->GetNodeCount() > 0) {
HIP_RETURN(hipErrorInvalidValue);
}
HIP_RETURN(hipSuccess);