Commit 5b8031a
authored
[Offload][AMDGPU] Correctly handle variable implicit argument sizes (llvm#142199)
Summary:
The size of the implicit argument struct can vary depending on
optimizations, it is not always the size as listed by the full struct.
Additionally, the implicit arguments are always aligned on a pointer
boundary. This patch updates the handling to use the correctly aligned
offset and only initialize the members if they are contained in the
reported size.
Additionally, we modify the `alloc` and `free` routines to allow
`alloc(0)` and `free(nullptr)` as these are mandated by the C standard
and allow us to easily handle cases where the user calls a kernel with
no arguments.1 parent 41e22aa commit 5b8031a
File tree
2 files changed
+49
-20
lines changed- offload/plugins-nextgen/amdgpu
- src
- utils
2 files changed
+49
-20
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3362 | 3362 | | |
3363 | 3363 | | |
3364 | 3364 | | |
3365 | | - | |
| 3365 | + | |
3366 | 3366 | | |
3367 | | - | |
| 3367 | + | |
3368 | 3368 | | |
3369 | 3369 | | |
3370 | 3370 | | |
| |||
3398 | 3398 | | |
3399 | 3399 | | |
3400 | 3400 | | |
3401 | | - | |
3402 | | - | |
3403 | | - | |
3404 | | - | |
3405 | | - | |
3406 | | - | |
3407 | | - | |
3408 | | - | |
3409 | | - | |
3410 | | - | |
3411 | | - | |
3412 | | - | |
3413 | | - | |
3414 | | - | |
3415 | | - | |
3416 | | - | |
3417 | | - | |
| 3401 | + | |
| 3402 | + | |
| 3403 | + | |
| 3404 | + | |
| 3405 | + | |
| 3406 | + | |
| 3407 | + | |
| 3408 | + | |
| 3409 | + | |
| 3410 | + | |
| 3411 | + | |
| 3412 | + | |
| 3413 | + | |
| 3414 | + | |
| 3415 | + | |
| 3416 | + | |
| 3417 | + | |
| 3418 | + | |
| 3419 | + | |
| 3420 | + | |
| 3421 | + | |
| 3422 | + | |
| 3423 | + | |
| 3424 | + | |
| 3425 | + | |
| 3426 | + | |
| 3427 | + | |
| 3428 | + | |
| 3429 | + | |
| 3430 | + | |
| 3431 | + | |
| 3432 | + | |
| 3433 | + | |
3418 | 3434 | | |
3419 | 3435 | | |
3420 | 3436 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
| 16 | + | |
16 | 17 | | |
17 | 18 | | |
18 | 19 | | |
| |||
26 | 27 | | |
27 | 28 | | |
28 | 29 | | |
29 | | - | |
| 30 | + | |
30 | 31 | | |
31 | 32 | | |
32 | 33 | | |
| |||
60 | 61 | | |
61 | 62 | | |
62 | 63 | | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
63 | 76 | | |
64 | 77 | | |
65 | 78 | | |
| |||
0 commit comments