omega-gpu-bench
First-party Omega GPU kernel benchmark harness and receipts
Brought by drakestapleton
omega-gpu-bench / kernels / src / neg.cuda.s2
| 1 | ; vecadd.cuda.s2 -- c[i] = a[i] + b[i] for sm_80: seed/sm80/vecadd.s2 with the CUDA ABI constant bank |
| 2 | ; instead of CUDA++'s (same instructions and schedule; only the constant offsets differ), so the kernel |
| 3 | ; can be loaded through NVIDIA's driver (cuModuleLoadData) as an interop oracle. Layout: |
| 4 | ; c[0x0][0x0] blockDim.x, 0x28 stack top, 0x160/0x168/0x170 a/b/c, 0x178 n (cubin signature pppu). |
| 5 | ; Referee: `nakref listing 80 <this> <out>` gives the same bytes as asm2 + sm80.tbl. |
| 6 | ; Each instruction is four lines; control line: c stall yield write-sb read-sb wait-mask reuse. |
| 7 | ldc.0 7 1 255 ; LDC R1, c[0x0][0x28] |
| 8 | cb.1 0x28 0 |
| 9 | ldc.2 4 0 |
| 10 | c 1 1 7 7 0 0 |
| 11 | s2r.0 7 9 ; S2R R9, SR_CTAID.X |
| 12 | z.1 |
| 13 | s2r.2 0x25 |
| 14 | c 1 1 0 7 0 0 |
| 15 | uldc.0 7 4 ; ULDC UR4, c[0x0][0x0] |
| 16 | cb.1 0x0 0 |
| 17 | uldc.2 4 |
| 18 | c 1 1 0 7 0 0 |
| 19 | s2r.0 7 0 ; S2R R0, SR_TID.X |
| 20 | z.1 |
| 21 | s2r.2 0x21 |
| 22 | c 1 1 0 7 0 0 |
| 23 | uldc.0 7 5 ; ULDC UR5, c[0x0][0x178] |
| 24 | cb.1 0x178 0 |
| 25 | uldc.2 4 |
| 26 | c 1 1 1 7 0 0 |
| 27 | imad.u.0 7 9 9 ; IMAD R9, R9, UR4, R0 |
| 28 | u.1 4 |
| 29 | imad.u.2 0 0 |
| 30 | c 5 0 7 7 1 0 |
| 31 | isetp.u.0 7 9 ; ISETP.GE.U32.AND P0, PT, R9, UR5, PT |
| 32 | u.1 5 |
| 33 | isetp.u.2 7 0 0 0 6 0 7 |
| 34 | c 13 0 7 7 2 0 |
| 35 | exit.0 0 ; @P0 EXIT |
| 36 | z.1 |
| 37 | exit.2 |
| 38 | c 5 1 7 7 0 0 |
| 39 | ldc.0 7 2 255 ; LDC.64 R2, c[0x0][0x160] |
| 40 | cb.1 0x160 0 |
| 41 | ldc.2 5 0 |
| 42 | c 1 1 0 7 0 0 |
| 43 | ldc.0 7 4 255 ; LDC.64 R4, c[0x0][0x168] |
| 44 | cb.1 0x168 0 |
| 45 | ldc.2 5 0 |
| 46 | c 8 1 2 7 0 0 |
| 47 | ldc.0 7 6 255 ; LDC.64 R6, c[0x0][0x170] |
| 48 | cb.1 0x170 0 |
| 49 | ldc.2 5 0 |
| 50 | c 1 1 3 7 0 0 |
| 51 | imadw.i.0 7 2 9 ; IMAD.WIDE.U32 R2, R9, 0x4, R2 |
| 52 | n.1 4 |
| 53 | imad.2 2 0 |
| 54 | c 6 0 7 7 1 0 |
| 55 | ldg.0 7 2 2 ; LDG.E R2, [R2.64] |
| 56 | ldg.1 63 0 |
| 57 | ldg.2 0 1 4 7 1 1 |
| 58 | c 1 1 4 7 0 0 |
| 59 | imadw.i.0 7 4 9 ; IMAD.WIDE.U32 R4, R9, 0x4, R4 |
| 60 | n.1 4 |
| 61 | imad.2 4 0 |
| 62 | c 6 0 7 7 4 0 |
| 63 | ldg.0 7 5 4 ; LDG.E R5, [R4.64] |
| 64 | ldg.1 63 0 |
| 65 | ldg.2 0 1 4 7 1 1 |
| 66 | c 1 1 4 7 0 0 |
| 67 | imadw.i.0 7 6 9 ; IMAD.WIDE.U32 R6, R9, 0x4, R6 |
| 68 | n.1 4 |
| 69 | imad.2 6 0 |
| 70 | c 1 1 7 7 8 0 |
| 71 | iadd3.0 7 9 2 ; IADD3 R9, R2, R5, RZ |
| 72 | r.1 4 ; NEGATIVE CONTROL: vecadd reads R5 here; neg reads R4, so c[i] != a[i] + b[i] |
| 73 | iadd3.2 255 7 7 |
| 74 | c 5 0 7 7 16 0 |
| 75 | stg.0 7 6 ; STG.E [R6.64], R9 |
| 76 | stg.1 9 0 |
| 77 | stg.2 63 1 4 7 1 1 |
| 78 | c 2 1 7 0 0 0 |
| 79 | exit.0 7 ; EXIT |
| 80 | z.1 |
| 81 | exit.2 |
| 82 | c 5 1 7 7 1 0 |
| 83 | bra.0 7 ; BRA to itself: distance -1 instruction |
| 84 | bra.1 0x0fffffff |
| 85 | bra.2 -1 7 |
| 86 | c 0 0 7 7 0 0 |