@@ -171,99 +171,148 @@ void printTestName(std::string name) {
171171#endif
172172}
173173
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+
174188int main () {
175189
176190 unsigned int seed = 0 ;
177191 bool failed = false ;
192+ int sizeIndex = 0 ;
178193
179194 printTestName (" Running cube int\n " );
180195 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++;
182199 printTestName (" Running cube int2\n " );
183200 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++;
185204 printTestName (" Running cube int4\n " );
186205 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++;
189209 printTestName (" Running cube unsigned int\n " );
190210 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++;
192214 printTestName (" Running cube unsigned int2\n " );
193215 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++;
195219 printTestName (" Running cube unsigned int4\n " );
196220 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++;
199224 printTestName (" Running cube short\n " );
200225 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++;
202229 printTestName (" Running cube short2\n " );
203230 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++;
205234 printTestName (" Running cube short4\n " );
206235 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++;
209239 printTestName (" Running cube unsigned short\n " );
210240 failed |=
211241 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++;
213245 printTestName (" Running cube unsigned short2\n " );
214246 failed |=
215247 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++;
217251 printTestName (" Running cube unsigned short4\n " );
218252 failed |=
219253 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++;
222257 printTestName (" Running cube char\n " );
223258 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++;
225262 printTestName (" Running cube char2\n " );
226263 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++;
228267 printTestName (" Running cube char4\n " );
229268 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++;
232272 printTestName (" Running cube unsigned char\n " );
233273 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++;
235277 printTestName (" Running cube unsigned char2\n " );
236278 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++;
238282 printTestName (" Running cube unsigned char4\n " );
239283 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++;
242287 printTestName (" Running cube float\n " );
243288 failed |=
244289 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++;
246292 printTestName (" Running cube float2\n " );
247293 failed |=
248294 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++;
250297 printTestName (" Running cube float4\n " );
251298 failed |=
252299 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++;
255302 printTestName (" Running cube half\n " );
256303 failed |=
257304 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++;
259307 printTestName (" Running cube half2\n " );
260308 failed |=
261309 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++;
263312 printTestName (" Running cube half4\n " );
264313 failed |=
265314 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);
267316
268317 if (failed) {
269318 std::cerr << " An error has occured!\n " ;
0 commit comments