From 234dc08f7cf28909e6d2a83694e86f335a0248d2 Mon Sep 17 00:00:00 2001 From: sdashmiz Date: Thu, 13 Oct 2022 13:48:34 -0400 Subject: [PATCH] SWDEV-361592 - allow nullptr for userdata in hiphostfunc Signed-off-by: sdashmiz Change-Id: I91728d363846ac6417d4a59920509ffacd4c9a58 [ROCm/clr commit: 9c83b3e0b28d833b6538a27a51c99cb60718aca7] --- projects/clr/hipamd/src/hip_graph.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/projects/clr/hipamd/src/hip_graph.cpp b/projects/clr/hipamd/src/hip_graph.cpp index 871ee7df7b..001de82924 100644 --- a/projects/clr/hipamd/src/hip_graph.cpp +++ b/projects/clr/hipamd/src/hip_graph.cpp @@ -785,7 +785,7 @@ hipError_t capturehipStreamWaitEvent(hipEvent_t& event, hipStream_t& stream, uns hipError_t capturehipLaunchHostFunc(hipStream_t& stream, hipHostFn_t& fn, void*& userData) { ClPrint(amd::LOG_INFO, amd::LOG_API, "[hipGraph] current capture node Memset2D on stream : %p", stream); - if (fn == nullptr || userData == nullptr || !hip::isValid(stream)) { + if (fn == nullptr || !hip::isValid(stream)) { return hipErrorInvalidValue; } hipHostNodeParams hostParams = {0}; @@ -1942,7 +1942,7 @@ hipError_t hipGraphHostNodeGetParams(hipGraphNode_t node, hipHostNodeParams* pNo hipError_t hipGraphHostNodeSetParams(hipGraphNode_t node, const hipHostNodeParams* pNodeParams) { HIP_INIT_API(hipGraphHostNodeSetParams, node, pNodeParams); - if (pNodeParams == nullptr || pNodeParams->fn == nullptr || pNodeParams->userData == nullptr || + if (pNodeParams == nullptr || pNodeParams->fn == nullptr || node == nullptr || !hipGraphNode::isNodeValid(node)) { HIP_RETURN(hipErrorInvalidValue); } @@ -1952,8 +1952,7 @@ hipError_t hipGraphHostNodeSetParams(hipGraphNode_t node, const hipHostNodeParam hipError_t hipGraphExecHostNodeSetParams(hipGraphExec_t hGraphExec, hipGraphNode_t node, const hipHostNodeParams* pNodeParams) { HIP_INIT_API(hipGraphExecHostNodeSetParams, hGraphExec, node, pNodeParams); - if (hGraphExec == nullptr || pNodeParams == nullptr || pNodeParams->fn == nullptr || - pNodeParams->userData == nullptr || node == nullptr || !hipGraphNode::isNodeValid(node)) { + if (hGraphExec == nullptr || pNodeParams == nullptr || pNodeParams->fn == nullptr || node == nullptr || !hipGraphNode::isNodeValid(node)) { HIP_RETURN(hipErrorInvalidValue); } hipGraphNode_t clonedNode = hGraphExec->GetClonedNode(node);