SWDEV-316819 - graph check ChildGraphNodeGetGraph

Change-Id: Id3a4fb64e6fb5ce37e97f1f3518e09c8bd9a2d0c
This commit is contained in:
Payam
2022-03-23 15:30:06 -04:00
committed by Payam Ghafari
parent 5f0f7ffe92
commit 8618b1cd07
2 changed files with 4 additions and 3 deletions
+3 -3
View File
@@ -1211,11 +1211,11 @@ hipError_t hipGraphExecKernelNodeSetParams(hipGraphExec_t hGraphExec, hipGraphNo
hipError_t hipGraphChildGraphNodeGetGraph(hipGraphNode_t node, hipGraph_t* pGraph) {
HIP_INIT_API(hipGraphChildGraphNodeGetGraph, node, pGraph);
if (node == nullptr || pGraph == nullptr) {
if (node == nullptr || pGraph == nullptr || !hipGraphNode::isNodeValid(node)) {
HIP_RETURN(hipErrorInvalidValue);
}
*pGraph = reinterpret_cast<hipChildGraphNode*>(node)->GetChildGraph();
if (pGraph == nullptr) {
*pGraph = reinterpret_cast<hipGraphNode*>(node)->GetChildGraph();
if (*pGraph == nullptr) {
HIP_RETURN(hipErrorInvalidValue);
}
HIP_RETURN(hipSuccess);
+1
View File
@@ -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; }
};