Commit abfeb88
ssjia
[ET-VK][ez] Implement helper functions to get fastest moving dim
Pull Request resolved: #17107
Add C++ and GLSL helpers to query the fastest moving dimension (the
dimension with stride 1 in buffer layout). This is useful for optimizing
memory access patterns in shaders, as iterating along the fastest moving
dimension maximizes cache locality.
The C++ `fastest_whcn_dim()` method accounts for block-transposed layouts by
returning `outer_packed_dim` instead of `packed_dim` when applicable. A
corresponding GLSL macro extracts this info from the hashed layout.
ghstack-source-id: 338638547
@exported-using-ghexport
Differential Revision: [D92061369](https://our.internmc.facebook.com/intern/diff/D92061369/)1 parent 1781382 commit abfeb88
3 files changed
Lines changed: 16 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
523 | 523 | | |
524 | 524 | | |
525 | 525 | | |
| 526 | + | |
| 527 | + | |
| 528 | + | |
| 529 | + | |
| 530 | + | |
| 531 | + | |
| 532 | + | |
| 533 | + | |
| 534 | + | |
| 535 | + | |
526 | 536 | | |
527 | 537 | | |
528 | 538 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
456 | 456 | | |
457 | 457 | | |
458 | 458 | | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
459 | 463 | | |
460 | 464 | | |
461 | 465 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
70 | 70 | | |
71 | 71 | | |
72 | 72 | | |
| 73 | + | |
| 74 | + | |
73 | 75 | | |
74 | 76 | | |
75 | 77 | | |
| |||
0 commit comments