From 707ca92a801a60a57912dd68179d1abf0612b355 Mon Sep 17 00:00:00 2001 From: Anusha GodavarthySurya Date: Mon, 19 Dec 2022 09:21:25 +0000 Subject: [PATCH] SWDEV-373147 - Return error when getDeviceKernel returns nullptr Change-Id: Ie9fcaa2bff87cb8ef363dc7e8362b74b8725b3b6 --- hipamd/src/hip_module.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/hipamd/src/hip_module.cpp b/hipamd/src/hip_module.cpp index b63b1f2ccf..b9cfd83d2f 100644 --- a/hipamd/src/hip_module.cpp +++ b/hipamd/src/hip_module.cpp @@ -230,6 +230,9 @@ hipError_t ihipLaunchKernel_validate(hipFunction_t f, uint32_t globalWorkSizeX, } hip::DeviceFunc* function = hip::DeviceFunc::asFunction(f); amd::Kernel* kernel = function->kernel(); + if (!kernel->getDeviceKernel(*device)) { + return hipErrorInvalidDevice; + } // Make sure the launch params are not larger than if specified launch_bounds // If it exceeds, then return a failure if (blockDimX * blockDimY * blockDimZ >