SWDEV-316819 - adding graph checks

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

Change-Id: Ia55921bca1e2745c9c97f2b7eb36244ffb719eb4


[ROCm/clr commit: 5dd91d698b]
이 커밋은 다음에 포함됨:
Payam
2022-03-10 18:01:51 -05:00
커밋한 사람 Payam Ghafari
부모 bc59991924
커밋 eff4583118
2개의 변경된 파일4개의 추가작업 그리고 1개의 파일을 삭제
+3 -1
파일 보기
@@ -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);
+1
파일 보기
@@ -224,6 +224,7 @@ struct hipGraphNode {
}
}
ihipGraph* GetParentGraph() { return parentGraph_; }
virtual ihipGraph* GetChildGraph() { return nullptr; }
void SetParentGraph(ihipGraph* graph) { parentGraph_ = graph; }
virtual hipError_t SetParams(hipGraphNode* node) { return hipSuccess; }
};