@@ -171,99 +171,148 @@ void printTestName(std::string name) {
171
171
#endif
172
172
}
173
173
174
+ sycl::range<2 > getCubeGlobal (size_t index) {
175
+ const std::vector<sycl::range<2 >> globalSizes = {{6 , 6 }, {10 , 10 }, {8 , 8 }};
176
+
177
+ return globalSizes[index % 3 ];
178
+ }
179
+
180
+ sycl::range<3 > getCubeLocal (size_t index) {
181
+
182
+ const std::vector<sycl::range<3 >> localSizes = {
183
+ {3 , 3 , 1 }, {5 , 5 , 3 }, {4 , 4 , 2 }};
184
+
185
+ return localSizes[index % 3 ];
186
+ }
187
+
174
188
int main () {
175
189
176
190
unsigned int seed = 0 ;
177
191
bool failed = false ;
192
+ int sizeIndex = 0 ;
178
193
179
194
printTestName (" Running cube int\n " );
180
195
failed |= run_test<int32_t , 1 , sycl::image_channel_type::signed_int32,
181
- class int_cube >({32 , 32 }, {16 , 16 , 2 }, seed);
196
+ class int_cube >(getCubeGlobal (sizeIndex),
197
+ getCubeLocal (sizeIndex), seed);
198
+ sizeIndex++;
182
199
printTestName (" Running cube int2\n " );
183
200
failed |= run_test<int32_t , 2 , sycl::image_channel_type::signed_int32,
184
- class int2_cube >({128 , 128 }, {16 , 16 , 3 }, seed);
201
+ class int2_cube >(getCubeGlobal (sizeIndex),
202
+ getCubeLocal (sizeIndex), seed);
203
+ sizeIndex++;
185
204
printTestName (" Running cube int4\n " );
186
205
failed |= run_test<int32_t , 4 , sycl::image_channel_type::signed_int32,
187
- class int4_cube >({64 , 64 }, {32 , 16 , 1 }, seed);
188
-
206
+ class int4_cube >(getCubeGlobal (sizeIndex),
207
+ getCubeLocal (sizeIndex), seed);
208
+ sizeIndex++;
189
209
printTestName (" Running cube unsigned int\n " );
190
210
failed |= run_test<uint32_t , 1 , sycl::image_channel_type::unsigned_int32,
191
- class uint_cube >({15 , 15 }, {5 , 3 , 1 }, seed);
211
+ class uint_cube >(getCubeGlobal (sizeIndex),
212
+ getCubeLocal (sizeIndex), seed);
213
+ sizeIndex++;
192
214
printTestName (" Running cube unsigned int2\n " );
193
215
failed |= run_test<uint32_t , 2 , sycl::image_channel_type::unsigned_int32,
194
- class uint2_cube >({90 , 90 }, {10 , 9 , 3 }, seed);
216
+ class uint2_cube >(getCubeGlobal (sizeIndex),
217
+ getCubeLocal (sizeIndex), seed);
218
+ sizeIndex++;
195
219
printTestName (" Running cube unsigned int4\n " );
196
220
failed |= run_test<uint32_t , 4 , sycl::image_channel_type::unsigned_int32,
197
- class uint4_cube >({1024 , 1024 }, {16 , 16 , 2 }, seed);
198
-
221
+ class uint4_cube >(getCubeGlobal (sizeIndex),
222
+ getCubeLocal (sizeIndex), seed);
223
+ sizeIndex++;
199
224
printTestName (" Running cube short\n " );
200
225
failed |= run_test<short , 1 , sycl::image_channel_type::signed_int16,
201
- class short_cube >({8 , 8 }, {2 , 2 , 1 }, seed);
226
+ class short_cube >(getCubeGlobal (sizeIndex),
227
+ getCubeLocal (sizeIndex), seed);
228
+ sizeIndex++;
202
229
printTestName (" Running cube short2\n " );
203
230
failed |= run_test<short , 2 , sycl::image_channel_type::signed_int16,
204
- class short2_cube >({8 , 8 }, {4 , 4 , 2 }, seed);
231
+ class short2_cube >(getCubeGlobal (sizeIndex),
232
+ getCubeLocal (sizeIndex), seed);
233
+ sizeIndex++;
205
234
printTestName (" Running cube short4\n " );
206
235
failed |= run_test<short , 4 , sycl::image_channel_type::signed_int16,
207
- class short4_cube >({8 , 8 }, {8 , 8 , 3 }, seed);
208
-
236
+ class short4_cube >(getCubeGlobal (sizeIndex),
237
+ getCubeLocal (sizeIndex), seed);
238
+ sizeIndex++;
209
239
printTestName (" Running cube unsigned short\n " );
210
240
failed |=
211
241
run_test<unsigned short , 1 , sycl::image_channel_type::unsigned_int16,
212
- class ushort_cube >({75 , 75 }, {25 , 5 , 1 }, seed);
242
+ class ushort_cube >(getCubeGlobal (sizeIndex),
243
+ getCubeLocal (sizeIndex), seed);
244
+ sizeIndex++;
213
245
printTestName (" Running cube unsigned short2\n " );
214
246
failed |=
215
247
run_test<unsigned short , 2 , sycl::image_channel_type::unsigned_int16,
216
- class ushort2_cube >({75 , 75 }, {15 , 3 , 2 }, seed);
248
+ class ushort2_cube >(getCubeGlobal (sizeIndex),
249
+ getCubeLocal (sizeIndex), seed);
250
+ sizeIndex++;
217
251
printTestName (" Running cube unsigned short4\n " );
218
252
failed |=
219
253
run_test<unsigned short , 4 , sycl::image_channel_type::unsigned_int16,
220
- class ushort4_cube >({75 , 75 }, {5 , 25 , 3 }, seed);
221
-
254
+ class ushort4_cube >(getCubeGlobal (sizeIndex),
255
+ getCubeLocal (sizeIndex), seed);
256
+ sizeIndex++;
222
257
printTestName (" Running cube char\n " );
223
258
failed |= run_test<signed char , 1 , sycl::image_channel_type::signed_int8,
224
- class char_cube >({60 , 60 }, {10 , 6 , 1 }, seed);
259
+ class char_cube >(getCubeGlobal (sizeIndex),
260
+ getCubeLocal (sizeIndex), seed);
261
+ sizeIndex++;
225
262
printTestName (" Running cube char2\n " );
226
263
failed |= run_test<signed char , 2 , sycl::image_channel_type::signed_int8,
227
- class char2_cube >({60 , 60 }, {5 , 3 , 2 }, seed);
264
+ class char2_cube >(getCubeGlobal (sizeIndex),
265
+ getCubeLocal (sizeIndex), seed);
266
+ sizeIndex++;
228
267
printTestName (" Running cube char4\n " );
229
268
failed |= run_test<signed char , 4 , sycl::image_channel_type::signed_int8,
230
- class char4_cube >({60 , 60 }, {6 , 10 , 3 }, seed);
231
-
269
+ class char4_cube >(getCubeGlobal (sizeIndex),
270
+ getCubeLocal (sizeIndex), seed);
271
+ sizeIndex++;
232
272
printTestName (" Running cube unsigned char\n " );
233
273
failed |= run_test<unsigned char , 1 , sycl::image_channel_type::unsigned_int8,
234
- class uchar_cube >({128 , 128 }, {16 , 16 , 3 }, seed);
274
+ class uchar_cube >(getCubeGlobal (sizeIndex),
275
+ getCubeLocal (sizeIndex), seed);
276
+ sizeIndex++;
235
277
printTestName (" Running cube unsigned char2\n " );
236
278
failed |= run_test<unsigned char , 2 , sycl::image_channel_type::unsigned_int8,
237
- class uchar2_cube >({128 , 128 }, {16 , 16 , 3 }, seed);
279
+ class uchar2_cube >(getCubeGlobal (sizeIndex),
280
+ getCubeLocal (sizeIndex), seed);
281
+ sizeIndex++;
238
282
printTestName (" Running cube unsigned char4\n " );
239
283
failed |= run_test<unsigned char , 4 , sycl::image_channel_type::unsigned_int8,
240
- class uchar4_cube >({128 , 128 }, {16 , 16 , 3 }, seed);
241
-
284
+ class uchar4_cube >(getCubeGlobal (sizeIndex),
285
+ getCubeLocal (sizeIndex), seed);
286
+ sizeIndex++;
242
287
printTestName (" Running cube float\n " );
243
288
failed |=
244
289
run_test<float , 1 , sycl::image_channel_type::fp32, class float_cube >(
245
- {1024 , 1024 }, {16 , 16 , 1 }, seed);
290
+ getCubeGlobal (sizeIndex), getCubeLocal (sizeIndex), seed);
291
+ sizeIndex++;
246
292
printTestName (" Running cube float2\n " );
247
293
failed |=
248
294
run_test<float , 2 , sycl::image_channel_type::fp32, class float2_cube >(
249
- {1024 , 1024 }, {16 , 16 , 3 }, seed);
295
+ getCubeGlobal (sizeIndex), getCubeLocal (sizeIndex), seed);
296
+ sizeIndex++;
250
297
printTestName (" Running cube float4\n " );
251
298
failed |=
252
299
run_test<float , 4 , sycl::image_channel_type::fp32, class float4_cube >(
253
- { 1024 , 1024 }, { 16 , 16 , 2 } , seed);
254
-
300
+ getCubeGlobal (sizeIndex), getCubeLocal (sizeIndex) , seed);
301
+ sizeIndex++;
255
302
printTestName (" Running cube half\n " );
256
303
failed |=
257
304
run_test<sycl::half, 1 , sycl::image_channel_type::fp16, class half_cube >(
258
- {48 , 48 }, {8 , 8 , 1 }, seed);
305
+ getCubeGlobal (sizeIndex), getCubeLocal (sizeIndex), seed);
306
+ sizeIndex++;
259
307
printTestName (" Running cube half2\n " );
260
308
failed |=
261
309
run_test<sycl::half, 2 , sycl::image_channel_type::fp16, class half2_cube >(
262
- {48 , 48 }, {8 , 8 , 3 }, seed);
310
+ getCubeGlobal (sizeIndex), getCubeLocal (sizeIndex), seed);
311
+ sizeIndex++;
263
312
printTestName (" Running cube half4\n " );
264
313
failed |=
265
314
run_test<sycl::half, 4 , sycl::image_channel_type::fp16, class half4_cube >(
266
- { 48 , 48 }, { 8 , 8 , 2 } , seed);
315
+ getCubeGlobal (sizeIndex), getCubeLocal (sizeIndex) , seed);
267
316
268
317
if (failed) {
269
318
std::cerr << " An error has occured!\n " ;
0 commit comments