Update enqueueKernel

Return CL_INVALID_GLOBAL_WORK_SIZE error if global_work_size contains 0 for
OpenCL older than 2.1
Do not throw exception if global_work_size contains 0

Related-To: NEO-3111

Change-Id: If7b7884465117d9c0615ace2bb682b3b1c7d8bdb
Signed-off-by: Filip Hazubski <filip.hazubski@intel.com>
This commit is contained in:
Filip Hazubski
2019-06-17 13:33:44 +02:00
committed by sys_ocldev
parent 3595e6e046
commit a9b8c07293
4 changed files with 85 additions and 57 deletions

View File

@ -64,6 +64,9 @@ cl_int CommandQueueHw<GfxFamily>::enqueueKernel(
for (auto i = 0u; i < workDim; i++) {
region[i] = globalWorkSizeIn ? globalWorkSizeIn[i] : 0;
if (region[i] == 0 && (kernel.getDevice().getEnabledClVersion() < 21)) {
return CL_INVALID_GLOBAL_WORK_SIZE;
}
globalWorkOffset[i] = globalWorkOffsetIn
? globalWorkOffsetIn[i]
: 0;
@ -78,7 +81,7 @@ cl_int CommandQueueHw<GfxFamily>::enqueueKernel(
return CL_INVALID_WORK_GROUP_SIZE;
}
if (kernel.getAllowNonUniform()) {
workGroupSize[i] = std::min(localWorkSizeIn[i], globalWorkSizeIn[i]);
workGroupSize[i] = std::min(localWorkSizeIn[i], std::max(static_cast<size_t>(1), globalWorkSizeIn[i]));
} else {
workGroupSize[i] = localWorkSizeIn[i];
}