Adding checks for function, size and params in ihipModuleLaunchKernel to have common message for hipModuleLaunch and hipExtModuleLaunch

Change-Id: I11921ad753930872572571dbfd1c12daba83a725


[ROCm/hip commit: 91ca6e6ab3]
This commit is contained in:
Jatin Chaudhary
2020-11-18 06:31:36 -05:00
committed by Jatin Chaudhary
szülő baffa1752d
commit 446cb45dc4
@@ -222,6 +222,16 @@ hipError_t ihipModuleLaunchKernel(hipFunction_t f, uint32_t globalWorkSizeX,
blockDimX, blockDimY, blockDimZ, sharedMemBytes, hStream, kernelParams, extra, startEvent,
stopEvent, flags, params);
if (f == nullptr) {
DevLogPrintfError("%s", "Function passed is null");
return hipErrorInvalidImage;
}
if ((kernelParams != nullptr) && (extra != nullptr)) {
DevLogPrintfError(
"%s", "Both, kernelParams and extra Params are provided, only one should be provided");
return hipErrorInvalidValue;
}
hip::DeviceFunc* function = hip::DeviceFunc::asFunction(f);
amd::Kernel* kernel = function->kernel();