SWDEV-316819 - graph check ChildGraphNodeGetGraph
Change-Id: Id3a4fb64e6fb5ce37e97f1f3518e09c8bd9a2d0c
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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; }
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user