@@ -1231,7 +1231,7 @@ hipError_t hipGraphExecMemcpyNodeSetParams1D(hipGraphExec_t hGraphExec, hipGraph
12311231 HIP_INIT_API (hipGraphExecMemcpyNodeSetParams1D, hGraphExec, node, dst, src, count, kind);
12321232 hip::GraphNode* n = reinterpret_cast <hip::GraphNode*>(node);
12331233 if (hGraphExec == nullptr || !hip::GraphNode::isNodeValid (n) || dst == nullptr ||
1234- src == nullptr || count == 0 || src == dst) {
1234+ src == nullptr || count == 0 || src == dst || n-> GetType () != hipGraphNodeTypeMemcpy ) {
12351235 HIP_RETURN (hipErrorInvalidValue);
12361236 }
12371237 hip::GraphNode* clonedNode = reinterpret_cast <hip::GraphNode*>(
@@ -1354,7 +1354,11 @@ hipError_t ihipGraphInstantiate(hip::GraphExec** pGraphExec, hip::Graph* graph,
13541354 }
13551355 std::vector<std::vector<hip::GraphNode*>> parallelLists;
13561356 std::unordered_map<hip::GraphNode*, std::vector<hip::GraphNode*>> nodeWaitLists;
1357- clonedGraph->GetRunList (parallelLists, nodeWaitLists);
1357+ if (DEBUG_HIP_FORCE_GRAPH_QUEUES == 1 ) {
1358+ parallelLists.push_back (graphNodes);
1359+ } else {
1360+ clonedGraph->GetRunList (parallelLists, nodeWaitLists);
1361+ }
13581362 if (DEBUG_HIP_FORCE_GRAPH_QUEUES != 0 ) {
13591363 clonedGraph->ScheduleNodes ();
13601364 }
@@ -1632,7 +1636,8 @@ hipError_t hipGraphExecMemcpyNodeSetParams(hipGraphExec_t hGraphExec, hipGraphNo
16321636 HIP_INIT_API (hipGraphExecMemcpyNodeSetParams, hGraphExec, node, pNodeParams);
16331637 hip::GraphNode* n = reinterpret_cast <hip::GraphNode*>(node);
16341638 if (hGraphExec == nullptr ||
1635- !hip::GraphNode::isNodeValid (reinterpret_cast <hip::GraphNode*>(n))) {
1639+ !hip::GraphNode::isNodeValid (reinterpret_cast <hip::GraphNode*>(n)) ||
1640+ n->GetType () != hipGraphNodeTypeMemcpy) {
16361641 HIP_RETURN (hipErrorInvalidValue);
16371642 }
16381643 if (ihipMemcpy3D_validate (pNodeParams) != hipSuccess) {
@@ -1693,7 +1698,7 @@ hipError_t hipGraphExecMemsetNodeSetParams(hipGraphExec_t hGraphExec, hipGraphNo
16931698 hip::GraphNode* n = reinterpret_cast <hip::GraphNode*>(node);
16941699
16951700 if (hGraphExec == nullptr || !hip::GraphNode::isNodeValid (n) || pNodeParams == nullptr ||
1696- pNodeParams->dst == nullptr ) {
1701+ pNodeParams->dst == nullptr || n-> GetType () != hipGraphNodeTypeMemset ) {
16971702 HIP_RETURN (hipErrorInvalidValue);
16981703 }
16991704 if (ihipGraphMemsetParams_validate (pNodeParams) != hipSuccess) {
@@ -1758,7 +1763,7 @@ hipError_t hipGraphExecKernelNodeSetParams(hipGraphExec_t hGraphExec, hipGraphNo
17581763 hip::GraphNode* n = reinterpret_cast <hip::GraphNode*>(node);
17591764 if (hGraphExec == nullptr ||
17601765 !hip::GraphNode::isNodeValid (n) ||
1761- pNodeParams == nullptr || pNodeParams->func == nullptr ) {
1766+ pNodeParams == nullptr || pNodeParams->func == nullptr || n-> GetType () != hipGraphNodeTypeKernel ) {
17621767 HIP_RETURN (hipErrorInvalidValue);
17631768 }
17641769 hip::GraphNode* clonedNode = reinterpret_cast <hip::GraphExec*>(hGraphExec)->GetClonedNode (n);
@@ -1795,7 +1800,7 @@ hipError_t hipGraphExecChildGraphNodeSetParams(hipGraphExec_t hGraphExec, hipGra
17951800 hip::GraphNode* n = reinterpret_cast <hip::GraphNode*>(node);
17961801 hip::Graph* cg = reinterpret_cast <hip::Graph*>(childGraph);
17971802 if (hGraphExec == nullptr || !hip::GraphNode::isNodeValid (n) || childGraph == nullptr ||
1798- !hip::Graph::isGraphValid (cg)) {
1803+ !hip::Graph::isGraphValid (cg) || n-> GetType () != hipGraphNodeTypeGraph ) {
17991804 HIP_RETURN (hipErrorInvalidValue);
18001805 }
18011806
@@ -2424,7 +2429,7 @@ hipError_t hipGraphExecEventWaitNodeSetEvent(hipGraphExec_t hGraphExec, hipGraph
24242429 hip::GraphNode* n = reinterpret_cast <hip::GraphNode*>(hNode);
24252430
24262431 if (hGraphExec == nullptr || hNode == nullptr || event == nullptr ||
2427- (n->GetType () != hipGraphNodeTypeWaitEvent)) {
2432+ (n->GetType () != hipGraphNodeTypeWaitEvent) || n-> GetType () != hipGraphNodeTypeWaitEvent ) {
24282433 HIP_RETURN (hipErrorInvalidValue);
24292434 }
24302435 hip::GraphNode* clonedNode = reinterpret_cast <hip::GraphExec*>(hGraphExec)->GetClonedNode (n);
@@ -2475,7 +2480,7 @@ hipError_t hipGraphExecHostNodeSetParams(hipGraphExec_t hGraphExec, hipGraphNode
24752480 HIP_INIT_API (hipGraphExecHostNodeSetParams, hGraphExec, node, pNodeParams);
24762481 hip::GraphNode* n = reinterpret_cast <hip::GraphNode*>(node);
24772482 if (hGraphExec == nullptr || pNodeParams == nullptr || pNodeParams->fn == nullptr ||
2478- !hip::GraphNode::isNodeValid (n)) {
2483+ !hip::GraphNode::isNodeValid (n) || n-> GetType () != hipGraphNodeTypeHost ) {
24792484 HIP_RETURN (hipErrorInvalidValue);
24802485 }
24812486 hip::GraphNode* clonedNode = reinterpret_cast <hip::GraphExec*>(hGraphExec)->GetClonedNode (n);
@@ -3161,7 +3166,8 @@ hipError_t hipGraphExecExternalSemaphoresSignalNodeSetParams(hipGraphExec_t hGra
31613166 hip::GraphNode* n = reinterpret_cast <hip::GraphNode*>(hNode);
31623167 hip::GraphExec* graphExec = reinterpret_cast <hip::GraphExec*>(hGraphExec);
31633168 if (hGraphExec == nullptr || hNode == nullptr || !hip::GraphExec::isGraphExecValid (graphExec) ||
3164- !hip::GraphNode::isNodeValid (n) || nodeParams == nullptr ) {
3169+ !hip::GraphNode::isNodeValid (n) || nodeParams == nullptr ||
3170+ n->GetType () != hipGraphNodeTypeExtSemaphoreSignal) {
31653171 HIP_RETURN (hipErrorInvalidValue);
31663172 }
31673173 hip::GraphNode* clonedNode = graphExec->GetClonedNode (n);
@@ -3179,7 +3185,8 @@ hipError_t hipGraphExecExternalSemaphoresWaitNodeSetParams(hipGraphExec_t hGraph
31793185 hip::GraphNode* n = reinterpret_cast <hip::GraphNode*>(hNode);
31803186 hip::GraphExec* graphExec = reinterpret_cast <hip::GraphExec*>(hGraphExec);
31813187 if (hGraphExec == nullptr || hNode == nullptr || !hip::GraphExec::isGraphExecValid (graphExec) ||
3182- !hip::GraphNode::isNodeValid (n) || nodeParams == nullptr ) {
3188+ !hip::GraphNode::isNodeValid (n) || nodeParams == nullptr ||
3189+ n->GetType () != hipGraphNodeTypeExtSemaphoreWait) {
31833190 HIP_RETURN (hipErrorInvalidValue);
31843191 }
31853192 hip::GraphNode* clonedNode = graphExec->GetClonedNode (n);
@@ -3322,12 +3329,12 @@ hipError_t ihipGraphNodeSetParams(hip::GraphNode* n, hipGraphNodeParams *nodePar
33223329 nodeParams->eventRecord .event );
33233330 break ;
33243331 case hipGraphNodeTypeExtSemaphoreSignal:
3325- status = hipErrorNotSupported;
3326- // to be added.
3332+ status = reinterpret_cast <hip::hipGraphExternalSemSignalNode*>(n)-> SetParams (
3333+ &nodeParams-> extSemSignal );
33273334 break ;
33283335 case hipGraphNodeTypeExtSemaphoreWait:
3329- status = hipErrorNotSupported;
3330- // to be added.
3336+ status = reinterpret_cast <hip::hipGraphExternalSemWaitNode*>(n)-> SetParams (
3337+ &nodeParams-> extSemWait );
33313338 break ;
33323339 case hipGraphNodeTypeMemAlloc:
33333340 status = hipErrorNotSupported;
0 commit comments