MCPcopy Create free account
hub / github.com/ROCm/clr / hipGraphExecChildGraphNodeSetParams

Function hipGraphExecChildGraphNodeSetParams

hipamd/src/hip_graph.cpp:1985–2028  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1983}
1984
1985hipError_t hipGraphExecChildGraphNodeSetParams(hipGraphExec_t hGraphExec, hipGraphNode_t node,
1986 hipGraph_t childGraph) {
1987 HIP_INIT_API(hipGraphExecChildGraphNodeSetParams, hGraphExec, node, childGraph);
1988
1989 if (hGraphExec == nullptr || childGraph == nullptr) {
1990 HIP_RETURN(hipErrorInvalidValue);
1991 }
1992
1993 hip::GraphNode* n = reinterpret_cast<hip::GraphNode*>(node);
1994 hip::Graph* cg = reinterpret_cast<hip::Graph*>(childGraph);
1995
1996 hipError_t status = validateChildGraphNodeSetParams(n, cg);
1997 if (status != hipSuccess) {
1998 return status;
1999 }
2000
2001 hip::GraphNode* clonedNode = reinterpret_cast<hip::GraphExec*>(hGraphExec)->GetClonedNode(n);
2002 if (clonedNode == nullptr) {
2003 HIP_RETURN(hipErrorInvalidValue);
2004 }
2005 status = reinterpret_cast<hip::ChildGraphNode*>(clonedNode)->SetParams(cg);
2006 if (status != hipSuccess) {
2007 return status;
2008 }
2009
2010 hip::ChildGraphNode* childNode = reinterpret_cast<hip::ChildGraphNode*>(clonedNode);
2011
2012 // After SetParams updates node parameters in-place, we need to update the cached AQL packets
2013 auto graphExec = reinterpret_cast<hip::GraphExec*>(hGraphExec);
2014 if (graphExec->IsSegmentSchedulingEnabled() || childNode->GetGraphCaptureStatus()) {
2015 std::vector<hip::GraphNode*> childGraphNodes;
2016 childNode->TopologicalOrder(childGraphNodes);
2017 for (std::vector<hip::GraphNode*>::size_type i = 0; i != childGraphNodes.size(); i++) {
2018 if (childGraphNodes[i]->GraphCaptureEnabled()) {
2019 status =
2020 childNode->UpdateAQLPacket(reinterpret_cast<hip::GraphKernelNode*>(childGraphNodes[i]));
2021 if (status != hipSuccess) {
2022 return status;
2023 }
2024 }
2025 }
2026 }
2027 return status;
2028}
2029
2030hipError_t hipStreamGetCaptureInfo_common(hipStream_t stream,
2031 hipStreamCaptureStatus* pCaptureStatus,

Callers

nothing calls this directly

Calls 9

GetClonedNodeMethod · 0.80
GetGraphCaptureStatusMethod · 0.80
UpdateAQLPacketMethod · 0.80
SetParamsMethod · 0.45
TopologicalOrderMethod · 0.45
sizeMethod · 0.45
GraphCaptureEnabledMethod · 0.45

Tested by

no test coverage detected