@@ -208,21 +208,28 @@ class HostKernel : public HostKernelBase {
208
208
209
209
sycl::range<Dims> Range (InitializedVal<Dims, range>::template get<0 >());
210
210
sycl::id<Dims> Offset;
211
+ sycl::range<Dims> Stride (
212
+ InitializedVal<Dims, range>::template get<1 >()); // initialized to 1
213
+ sycl::range<Dims> UpperBound (
214
+ InitializedVal<Dims, range>::template get<0 >());
211
215
for (int I = 0 ; I < Dims; ++I) {
212
216
Range[I] = NDRDesc.GlobalSize [I];
213
217
Offset[I] = NDRDesc.GlobalOffset [I];
218
+ UpperBound[I] = Range[I] + Offset[I];
214
219
}
215
220
216
- detail::NDLoop<Dims>::iterate(Range, [&](const sycl::id<Dims> &ID) {
217
- sycl::item<Dims, /* Offset=*/ true > Item =
218
- IDBuilder::createItem<Dims, true >(Range, ID, Offset);
219
-
220
- if (StoreLocation) {
221
- store_id (&ID);
222
- store_item (&Item);
223
- }
224
- MKernel (ID);
225
- });
221
+ detail::NDLoop<Dims>::iterate(/* LowerBound=*/ Offset, Stride, UpperBound,
222
+ [&](const sycl::id<Dims> &ID) {
223
+ sycl::item<Dims, /* Offset=*/ true > Item =
224
+ IDBuilder::createItem<Dims, true >(
225
+ Range, ID, Offset);
226
+
227
+ if (StoreLocation) {
228
+ store_id (&ID);
229
+ store_item (&Item);
230
+ }
231
+ MKernel (ID);
232
+ });
226
233
}
227
234
228
235
template <class ArgT = KernelArgType>
@@ -259,22 +266,28 @@ class HostKernel : public HostKernelBase {
259
266
260
267
sycl::range<Dims> Range (InitializedVal<Dims, range>::template get<0 >());
261
268
sycl::id<Dims> Offset;
269
+ sycl::range<Dims> Stride (
270
+ InitializedVal<Dims, range>::template get<1 >()); // initialized to 1
271
+ sycl::range<Dims> UpperBound (
272
+ InitializedVal<Dims, range>::template get<0 >());
262
273
for (int I = 0 ; I < Dims; ++I) {
263
274
Range[I] = NDRDesc.GlobalSize [I];
264
275
Offset[I] = NDRDesc.GlobalOffset [I];
276
+ UpperBound[I] = Range[I] + Offset[I];
265
277
}
266
278
267
- detail::NDLoop<Dims>::iterate(Range, [&](const sycl::id<Dims> &ID) {
268
- sycl::id<Dims> OffsetID = ID + Offset;
269
- sycl::item<Dims, /* Offset=*/ true > Item =
270
- IDBuilder::createItem<Dims, true >(Range, OffsetID, Offset);
271
-
272
- if (StoreLocation) {
273
- store_id (&OffsetID);
274
- store_item (&Item);
275
- }
276
- MKernel (Item);
277
- });
279
+ detail::NDLoop<Dims>::iterate(/* LowerBound=*/ Offset, Stride, UpperBound,
280
+ [&](const sycl::id<Dims> &ID) {
281
+ sycl::item<Dims, /* Offset=*/ true > Item =
282
+ IDBuilder::createItem<Dims, true >(
283
+ Range, ID, Offset);
284
+
285
+ if (StoreLocation) {
286
+ store_id (&ID);
287
+ store_item (&Item);
288
+ }
289
+ MKernel (Item);
290
+ });
278
291
}
279
292
280
293
template <class ArgT = KernelArgType>
0 commit comments