| 3078 | } |
| 3079 | |
| 3080 | hipError_t hipGraphNodeSetEnabled(hipGraphExec_t hGraphExec, hipGraphNode_t hNode, |
| 3081 | unsigned int isEnabled) { |
| 3082 | HIP_INIT_API(hipGraphNodeSetEnabled, hGraphExec, hNode, isEnabled); |
| 3083 | hip::GraphExec* graphExec = reinterpret_cast<hip::GraphExec*>(hGraphExec); |
| 3084 | hip::GraphNode* node = reinterpret_cast<hip::GraphNode*>(hNode); |
| 3085 | if (hGraphExec == nullptr || hNode == nullptr || !hip::GraphExec::isGraphExecValid(graphExec) || |
| 3086 | !hip::GraphNode::isNodeValid(node)) { |
| 3087 | HIP_RETURN(hipErrorInvalidValue); |
| 3088 | } |
| 3089 | hip::GraphNode* clonedNode = graphExec->GetClonedNode(node); |
| 3090 | if (clonedNode == nullptr) { |
| 3091 | HIP_RETURN(hipErrorInvalidValue); |
| 3092 | } |
| 3093 | if (!(node->GetType() == hipGraphNodeTypeKernel || node->GetType() == hipGraphNodeTypeMemcpy || |
| 3094 | node->GetType() == hipGraphNodeTypeMemset)) { |
| 3095 | HIP_RETURN(hipErrorInvalidValue); |
| 3096 | } |
| 3097 | clonedNode->SetEnabled(isEnabled); |
| 3098 | |
| 3099 | hipError_t status = hipSuccess; |
| 3100 | if (graphExec->IsSegmentSchedulingEnabled()) { |
| 3101 | // Update packet batches when node is enabled/disabled |
| 3102 | status = graphExec->UpdatePacketBatchesForNodeEnableDisable(clonedNode, isEnabled != 0); |
| 3103 | if (status != hipSuccess) { |
| 3104 | HIP_RETURN(status); |
| 3105 | } |
| 3106 | } |
| 3107 | HIP_RETURN(status); |
| 3108 | } |
| 3109 | |
| 3110 | hipError_t hipGraphNodeGetEnabled(hipGraphExec_t hGraphExec, hipGraphNode_t hNode, |
| 3111 | unsigned int* isEnabled) { |
nothing calls this directly
no test coverage detected