@@ -177,7 +177,6 @@ bool handleInvalidWorkGroupSize(const device_impl &DeviceImpl, pi_kernel Kernel,
177
177
178
178
const plugin &Plugin = DeviceImpl.getPlugin ();
179
179
RT::PiDevice Device = DeviceImpl.getHandleRef ();
180
-
181
180
if (HasLocalSize) {
182
181
size_t MaxThreadsPerBlock[3 ] = {};
183
182
Plugin.call <PiApiKind::piDeviceGetInfo>(
@@ -211,6 +210,27 @@ bool handleInvalidWorkGroupSize(const device_impl &DeviceImpl, pi_kernel Kernel,
211
210
" PI backend failed. PI backend returns: " + codeToString (Error), Error);
212
211
}
213
212
213
+ bool handleInvalidWorkItemSize (const device_impl &DeviceImpl,
214
+ const NDRDescT &NDRDesc) {
215
+
216
+ const plugin &Plugin = DeviceImpl.getPlugin ();
217
+ RT::PiDevice Device = DeviceImpl.getHandleRef ();
218
+
219
+ size_t MaxWISize[] = {0 , 0 , 0 };
220
+
221
+ Plugin.call <PiApiKind::piDeviceGetInfo>(Device, PI_DEVICE_MAX_WORK_ITEM_SIZE,
222
+ sizeof (MaxWISize), &MaxWISize,
223
+ nullptr );
224
+ for (int i = 0 ; i < NDRDesc.Dims ; i++) {
225
+ if (NDRDesc.LocalSize [i] > MaxWISize[i])
226
+ throw sycl::nd_range_error (" Number of local work group number " +
227
+ std::to_string (i) +
228
+ " greater then corresponding values"
229
+ " PI_DEVISE_MAX_WORK_SIZE" ,
230
+ PI_INVALID_WORK_ITEM_SIZE);
231
+ }
232
+ }
233
+
214
234
bool handleError (pi_result Error, const device_impl &DeviceImpl,
215
235
pi_kernel Kernel, const NDRDescT &NDRDesc) {
216
236
assert (Error != PI_SUCCESS &&
0 commit comments