Commit b495645
authored
[AMD] Implement
Similar to `tl.extra.cuda.globaltimer`, this PR exposes
`tl.extra.hip.memrealtime` for AMD GPU. This is useful
for measuring the timing information for AMD kernels.
Reference:
https://www.amd.com/content/dam/amd/en/documents/radeon-tech-docs/instruction-set-architectures/rdna2-shader-instruction-set-architecture.pdf
> 7.2.3. S_MEMREALTIME
> This instruction reads a 64-bit "real time-counter" and returns the
> value into a pair of SGPRS:
> SDST and SDST+1. The time value is from a clock for which the
> frequency is constant (not affected by power modes or core clock
> frequency changes).
> Because the instructions can return out-of-order, the only sensible
> way to use this counter is to implement S_WAITCNT 0; this imposes
> a wait for all data to return from previous SMEMs before continuing.tl.extra.hip.memrealtime for timing (#7282)1 parent 1607e09 commit b495645
File tree
3 files changed
+35
-8
lines changed- python/test/unit/language
- third_party/amd/language/hip
3 files changed
+35
-8
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5930 | 5930 | | |
5931 | 5931 | | |
5932 | 5932 | | |
5933 | | - | |
5934 | | - | |
5935 | 5933 | | |
5936 | 5934 | | |
5937 | 5935 | | |
5938 | | - | |
5939 | | - | |
| 5936 | + | |
| 5937 | + | |
5940 | 5938 | | |
5941 | 5939 | | |
5942 | 5940 | | |
5943 | | - | |
| 5941 | + | |
5944 | 5942 | | |
5945 | 5943 | | |
5946 | 5944 | | |
5947 | 5945 | | |
5948 | | - | |
| 5946 | + | |
| 5947 | + | |
| 5948 | + | |
| 5949 | + | |
| 5950 | + | |
5949 | 5951 | | |
5950 | | - | |
| 5952 | + | |
| 5953 | + | |
| 5954 | + | |
| 5955 | + | |
5951 | 5956 | | |
5952 | 5957 | | |
5953 | 5958 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 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 | + | |
0 commit comments