Commit 80b52dd
committed
fix(non_uniform_work_group): respect per-dimension work item size limits when selecting localSize
Problem:
Test cases selected localSize based only on CL_KERNEL_WORK_GROUP_SIZE,
without considering CL_DEVICE_MAX_WORK_ITEM_SIZES per-dimension limits.
This caused issues because:
1. Constructor rounds globalSize based on the original localSize
2. prepareDevice() later trims _enqueuedLocalSize to device limits
3. Result: globalSize was rounded with wrong localSize, causing mismatch
For example, with maxWorkItemSizes=[256,256,64] and localSize={512,1}:
- globalSize rounded assuming localSize[0]=512
- prepareDevice() limits localSize[0] to 256
- globalSize and localSize no longer match
Fix:
Query CL_DEVICE_MAX_WORK_ITEM_SIZES in test cases and compute:
effectiveMax = min(maxWgSize, maxWorkItemSizes[dim])
before selecting localSize for each dimension.
This ensures localSize is valid before rounding, so globalSize and
localSize remain consistent throughout the test.
Affected files:
- test_advanced_2d.cpp
- test_advanced_3d.cpp
- test_advanced_other.cpp
- test_basic.cpp
Signed-off-by: jiajia Qian <jiajia.qian@nxp.com>1 parent d00c0c3 commit 80b52dd
3 files changed
Lines changed: 72 additions & 18 deletions
File tree
- test_conformance/non_uniform_work_group
Lines changed: 24 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
139 | 139 | | |
140 | 140 | | |
141 | 141 | | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
142 | 148 | | |
143 | | - | |
| 149 | + | |
144 | 150 | | |
145 | 151 | | |
146 | 152 | | |
| |||
149 | 155 | | |
150 | 156 | | |
151 | 157 | | |
152 | | - | |
| 158 | + | |
153 | 159 | | |
154 | 160 | | |
155 | 161 | | |
| |||
281 | 287 | | |
282 | 288 | | |
283 | 289 | | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
284 | 296 | | |
285 | | - | |
| 297 | + | |
286 | 298 | | |
287 | 299 | | |
288 | 300 | | |
| |||
291 | 303 | | |
292 | 304 | | |
293 | 305 | | |
294 | | - | |
| 306 | + | |
295 | 307 | | |
296 | 308 | | |
297 | 309 | | |
| |||
421 | 433 | | |
422 | 434 | | |
423 | 435 | | |
| 436 | + | |
| 437 | + | |
| 438 | + | |
| 439 | + | |
| 440 | + | |
| 441 | + | |
424 | 442 | | |
425 | | - | |
| 443 | + | |
426 | 444 | | |
427 | 445 | | |
428 | 446 | | |
| |||
431 | 449 | | |
432 | 450 | | |
433 | 451 | | |
434 | | - | |
| 452 | + | |
435 | 453 | | |
436 | 454 | | |
437 | 455 | | |
| |||
Lines changed: 24 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
112 | 112 | | |
113 | 113 | | |
114 | 114 | | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
115 | 121 | | |
116 | | - | |
| 122 | + | |
117 | 123 | | |
118 | 124 | | |
119 | 125 | | |
| |||
122 | 128 | | |
123 | 129 | | |
124 | 130 | | |
125 | | - | |
| 131 | + | |
126 | 132 | | |
127 | 133 | | |
128 | 134 | | |
| |||
266 | 272 | | |
267 | 273 | | |
268 | 274 | | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
269 | 281 | | |
270 | | - | |
| 282 | + | |
271 | 283 | | |
272 | 284 | | |
273 | 285 | | |
| |||
276 | 288 | | |
277 | 289 | | |
278 | 290 | | |
279 | | - | |
| 291 | + | |
280 | 292 | | |
281 | 293 | | |
282 | 294 | | |
| |||
420 | 432 | | |
421 | 433 | | |
422 | 434 | | |
| 435 | + | |
| 436 | + | |
| 437 | + | |
| 438 | + | |
| 439 | + | |
| 440 | + | |
423 | 441 | | |
424 | | - | |
| 442 | + | |
425 | 443 | | |
426 | 444 | | |
427 | 445 | | |
| |||
430 | 448 | | |
431 | 449 | | |
432 | 450 | | |
433 | | - | |
| 451 | + | |
434 | 452 | | |
435 | 453 | | |
436 | 454 | | |
| |||
Lines changed: 24 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
48 | 48 | | |
49 | 49 | | |
50 | 50 | | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
51 | 57 | | |
52 | | - | |
| 58 | + | |
53 | 59 | | |
54 | 60 | | |
55 | 61 | | |
| |||
58 | 64 | | |
59 | 65 | | |
60 | 66 | | |
61 | | - | |
| 67 | + | |
62 | 68 | | |
63 | 69 | | |
64 | 70 | | |
| |||
149 | 155 | | |
150 | 156 | | |
151 | 157 | | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
152 | 164 | | |
153 | | - | |
| 165 | + | |
154 | 166 | | |
155 | 167 | | |
156 | 168 | | |
| |||
159 | 171 | | |
160 | 172 | | |
161 | 173 | | |
162 | | - | |
| 174 | + | |
163 | 175 | | |
164 | 176 | | |
165 | 177 | | |
| |||
249 | 261 | | |
250 | 262 | | |
251 | 263 | | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
252 | 270 | | |
253 | | - | |
| 271 | + | |
254 | 272 | | |
255 | 273 | | |
256 | 274 | | |
| |||
259 | 277 | | |
260 | 278 | | |
261 | 279 | | |
262 | | - | |
| 280 | + | |
263 | 281 | | |
264 | 282 | | |
265 | 283 | | |
| |||
0 commit comments