Commit ac504c8
ssjia
[ET-VK][ez] Implement helper functions to get fastest moving dim
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.
Differential Revision: [D92061369](https://our.internmc.facebook.com/intern/diff/D92061369/)
[ghstack-poisoned]1 parent 6595b1f commit ac504c8
3 files changed
Lines changed: 16 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
513 | 513 | | |
514 | 514 | | |
515 | 515 | | |
| 516 | + | |
| 517 | + | |
| 518 | + | |
| 519 | + | |
| 520 | + | |
| 521 | + | |
| 522 | + | |
| 523 | + | |
| 524 | + | |
| 525 | + | |
516 | 526 | | |
517 | 527 | | |
518 | 528 | | |
| |||
| 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