mirror of
https://github.com/intel/compute-runtime.git
synced 2025-09-15 13:01:45 +08:00
Add check for local work group size in clEnqueueNDRangeKernel call.
- Incoming local work group size cannot exceed device capabilities. Change-Id: I89a7503155c71443e3ebc630debb5d5b466c6cb5
This commit is contained in:
@ -71,6 +71,7 @@ cl_int CommandQueueHw<GfxFamily>::enqueueKernel(
|
||||
}
|
||||
|
||||
size_t remainder = 0;
|
||||
size_t totalWorkItems = 1u;
|
||||
const size_t *localWkgSizeToPass = localWorkSizeIn ? workGroupSize : nullptr;
|
||||
|
||||
for (auto i = 0u; i < workDim; i++) {
|
||||
@ -86,6 +87,7 @@ cl_int CommandQueueHw<GfxFamily>::enqueueKernel(
|
||||
}
|
||||
}
|
||||
workGroupSize[i] = localWorkSizeIn[i];
|
||||
totalWorkItems *= localWorkSizeIn[i];
|
||||
}
|
||||
|
||||
remainder += region[i] % workGroupSize[i];
|
||||
@ -126,6 +128,10 @@ cl_int CommandQueueHw<GfxFamily>::enqueueKernel(
|
||||
",", globalWorkSizeIn[2],
|
||||
",SIMD:, ", kernel.getKernelInfo().getMaxSimdSize());
|
||||
|
||||
if (totalWorkItems > this->getDevice().getDeviceInfo().maxWorkGroupSize) {
|
||||
return CL_INVALID_WORK_GROUP_SIZE;
|
||||
}
|
||||
|
||||
enqueueHandler<CL_COMMAND_NDRANGE_KERNEL>(
|
||||
surfaces,
|
||||
false,
|
||||
|
Reference in New Issue
Block a user