From ed487980cde6664293794da35bea930d8a07cd4f Mon Sep 17 00:00:00 2001 From: Ajay Date: Tue, 22 Mar 2022 21:04:19 +0000 Subject: [PATCH] SWDEV-315567 - hipGraphNodeTypeEventRecord node type get/set fixes Change-Id: I76e866990a153fb254e1187e7fabcc1f93806469 --- hipamd/src/hip_graph.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/hipamd/src/hip_graph.cpp b/hipamd/src/hip_graph.cpp index b4723282f3..14b98b082f 100644 --- a/hipamd/src/hip_graph.cpp +++ b/hipamd/src/hip_graph.cpp @@ -1620,7 +1620,8 @@ hipError_t hipGraphAddEventRecordNode(hipGraphNode_t* pGraphNode, hipGraph_t gra hipError_t hipGraphEventRecordNodeGetEvent(hipGraphNode_t node, hipEvent_t* event_out) { HIP_INIT_API(hipGraphEventRecordNodeGetEvent, node, event_out); - if (node == nullptr || event_out == nullptr) { + if (node == nullptr || event_out == nullptr || + node->GetType() != hipGraphNodeTypeEventRecord) { HIP_RETURN(hipErrorInvalidValue); } reinterpret_cast(node)->GetParams(event_out); @@ -1629,7 +1630,8 @@ hipError_t hipGraphEventRecordNodeGetEvent(hipGraphNode_t node, hipEvent_t* even hipError_t hipGraphEventRecordNodeSetEvent(hipGraphNode_t node, hipEvent_t event) { HIP_INIT_API(hipGraphEventRecordNodeSetEvent, node, event); - if (node == nullptr || event == nullptr) { + if (node == nullptr || event == nullptr || + node->GetType() != hipGraphNodeTypeEventRecord ) { HIP_RETURN(hipErrorInvalidValue); } HIP_RETURN(reinterpret_cast(node)->SetParams(event));