SWDEV-419996 - Allow both kernelParams and extra arguments to be set to null

When kernel function expects no parameters no error should be returned
if both kernelParams and extra arguments are set to null.

Change-Id: I5941bcc400b6fb380e623bdae0233ae3e4f73815


[ROCm/clr commit: 315082e554]
Этот коммит содержится в:
Ioannis Assiouras
2023-08-31 15:55:58 +01:00
родитель 5d9912f48b
Коммит a0ee7e2784
3 изменённых файлов: 6 добавлений и 8 удалений
+5 -1
Просмотреть файл
@@ -234,6 +234,11 @@ hipError_t ihipLaunchKernel_validate(hipFunction_t f, uint32_t globalWorkSizeX,
}
hip::DeviceFunc* function = hip::DeviceFunc::asFunction(f);
amd::Kernel* kernel = function->kernel();
const amd::KernelSignature& signature = kernel->signature();
if ((signature.numParameters() > 0) && (kernelParams == nullptr) && (extra == nullptr)) {
LogPrintfError("%s","At least one of kernelParams or extra Params should be provided");
return hipErrorInvalidValue;
}
if (!kernel->getDeviceKernel(*device)) {
return hipErrorInvalidDevice;
}
@@ -285,7 +290,6 @@ hipError_t ihipLaunchKernel_validate(hipFunction_t f, uint32_t globalWorkSizeX,
kernargs = reinterpret_cast<address>(extra[1]);
}
const amd::KernelSignature& signature = kernel->signature();
for (size_t i = 0; i < signature.numParameters(); ++i) {
const amd::KernelParameterDescriptor& desc = signature.at(i);
if (kernelParams == nullptr) {