Commit 12d7c1f
authored
[SYCL][sycl-post-link] Add post-struct padding in descs and fix blob size calculations (#5376)
These changes fix two related issues:
1. The runtime does not correctly handle the offset in specialization
constant descriptors as it does not take into account the size of the
previous element in composite types, effectively always adding
padding between each element equal to at least the size of the
previous element. This is fixed by changing it to keep track of the
local offset into the current composite type and subtracting that
from the offset of the descriptor to find the required padding.
2. Composite types may have padding at the end. sycl-post-link does not
currently generate enough information for the runtime to take the
additional padding into account when calculating the size of the
specialization constant default value blob. This is fixed by
inserting an additional descriptor after the last element of
a composite type with end-padding. This "padding-descriptor" will
have the offset right after the last element of the composite type
and a size corresponding to the size of the required padding.
padding-descriptors all have the same ID, namely the maximum value
of the (unsigned) ID.
Signed-off-by: Steffen Larsen <steffen.larsen@intel.com>1 parent 88123c1 commit 12d7c1f
File tree
3 files changed
+125
-19
lines changed- llvm
- test/tools/sycl-post-link/spec-constants
- tools/sycl-post-link
- sycl/source/detail
3 files changed
+125
-19
lines changedLines changed: 73 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
236 | 236 | | |
237 | 237 | | |
238 | 238 | | |
239 | | - | |
| 239 | + | |
240 | 240 | | |
241 | 241 | | |
242 | 242 | | |
243 | 243 | | |
244 | 244 | | |
245 | 245 | | |
246 | | - | |
| 246 | + | |
247 | 247 | | |
248 | 248 | | |
249 | 249 | | |
250 | 250 | | |
| 251 | + | |
| 252 | + | |
251 | 253 | | |
252 | 254 | | |
253 | 255 | | |
254 | 256 | | |
255 | 257 | | |
256 | 258 | | |
257 | 259 | | |
258 | | - | |
259 | | - | |
| 260 | + | |
| 261 | + | |
260 | 262 | | |
261 | 263 | | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
262 | 277 | | |
263 | 278 | | |
264 | 279 | | |
| |||
267 | 282 | | |
268 | 283 | | |
269 | 284 | | |
270 | | - | |
| 285 | + | |
271 | 286 | | |
272 | 287 | | |
273 | 288 | | |
274 | 289 | | |
275 | | - | |
| 290 | + | |
276 | 291 | | |
277 | 292 | | |
278 | | - | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
279 | 297 | | |
280 | 298 | | |
281 | 299 | | |
| |||
392 | 410 | | |
393 | 411 | | |
394 | 412 | | |
395 | | - | |
396 | | - | |
397 | | - | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
| 419 | + | |
| 420 | + | |
| 421 | + | |
398 | 422 | | |
399 | 423 | | |
400 | 424 | | |
401 | | - | |
| 425 | + | |
402 | 426 | | |
403 | 427 | | |
404 | 428 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
267 | 267 | | |
268 | 268 | | |
269 | 269 | | |
270 | | - | |
| 270 | + | |
271 | 271 | | |
272 | 272 | | |
273 | | - | |
274 | | - | |
275 | | - | |
276 | | - | |
277 | | - | |
278 | | - | |
279 | | - | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
280 | 286 | | |
281 | 287 | | |
282 | 288 | | |
| |||
288 | 294 | | |
289 | 295 | | |
290 | 296 | | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
291 | 300 | | |
292 | 301 | | |
293 | 302 | | |
| |||
0 commit comments