CUDApp
CUDA++: AIEN’s GPU machine-code toolchain, runtime and driver client for NVIDIA GPUs without the CUDA toolkit. Hardware coverage and driver replacement limits are explicit.
Brought by drakestapleton
CUDApp / tools / sm121dis / oracle_pairs.sh
| 1 | #!/bin/sh |
| 2 | # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception |
| 3 | # oracle_pairs.sh <nvdisasm -hex output>: one line per instruction, "<addr> <low 64 bits> <high 64 bits> <text> ;", |
| 4 | # text with spacing collapsed but the space before the semicolon kept (nvdisasm leaves it out on padding words). |
| 5 | # The C6 oracle side (docs/OMEGA.md): nvdisasm decodes, nothing it prints enters a kernel. |
| 6 | awk ' |
| 7 | /^[[:space:]]*\/\*[0-9a-f]+\*\// { |
| 8 | line = $0 |
| 9 | addr = line; sub(/^[[:space:]]*\/\*/, "", addr); sub(/\*\/.*/, "", addr) |
| 10 | txt = line; sub(/^[[:space:]]*\/\*[0-9a-f]+\*\/[[:space:]]*/, "", txt); sub(/;.*$/, ";", txt) |
| 11 | lo = line; sub(/.*\/\* 0x/, "", lo); sub(/ \*\/.*/, "", lo) |
| 12 | gsub(/[[:space:]]+/, " ", txt) |
| 13 | pend = 1; next |
| 14 | } |
| 15 | pend && /\/\* 0x[0-9a-f]+ \*\// { hi = $0; sub(/.*\/\* 0x/, "", hi); sub(/ \*\/.*/, "", hi); print addr, lo, hi, txt; pend = 0 } |
| 16 | ' "$1" |