SWDEV-316991 - Returns hipErrorInvalidValue when a wrong node type is passed to hipGraphExecEventWaitNodeSetEvent and hipGraphExecEventRecordNodeSetEvent APIs

Change-Id: Ic80b0b2b154e017b41af617f5049e037a1b66183


[ROCm/clr commit: f73ff54fda]
This commit is contained in:
Sourabh Betigeri
2022-03-21 16:31:49 -07:00
committed by Sourabh Betigeri
parent 993b9f790c
commit 636464ff5f
+4 -2
View File
@@ -1638,7 +1638,8 @@ hipError_t hipGraphEventRecordNodeSetEvent(hipGraphNode_t node, hipEvent_t event
hipError_t hipGraphExecEventRecordNodeSetEvent(hipGraphExec_t hGraphExec, hipGraphNode_t hNode,
hipEvent_t event) {
HIP_INIT_API(hipGraphExecEventRecordNodeSetEvent, hGraphExec, hNode, event);
if (hGraphExec == nullptr || hNode == nullptr || event == nullptr) {
if (hGraphExec == nullptr || hNode == nullptr || event == nullptr ||
hNode->GetType() != hipGraphNodeTypeEventRecord) {
HIP_RETURN(hipErrorInvalidValue);
}
hipGraphNode_t clonedNode = hGraphExec->GetClonedNode(hNode);
@@ -1683,7 +1684,8 @@ hipError_t hipGraphEventWaitNodeSetEvent(hipGraphNode_t node, hipEvent_t event)
hipError_t hipGraphExecEventWaitNodeSetEvent(hipGraphExec_t hGraphExec, hipGraphNode_t hNode,
hipEvent_t event) {
HIP_INIT_API(hipGraphExecEventWaitNodeSetEvent, hGraphExec, hNode, event);
if (hGraphExec == nullptr || hNode == nullptr || event == nullptr) {
if (hGraphExec == nullptr || hNode == nullptr || event == nullptr ||
(hNode->GetType() != hipGraphNodeTypeWaitEvent)) {
HIP_RETURN(hipErrorInvalidValue);
}
hipGraphNode_t clonedNode = hGraphExec->GetClonedNode(hNode);