Interplane page as plain text, for reading tools and agents. English is the reference text: translate it with your own tool. Text in backticks and in ``` blocks (commands, fingerprints, file names) and link targets in <...> are exact: copy them, never translate them. Page: /drakestapleton/CUDApp/blob/main/tools/prof/stamp_oracle.c # 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 Sign in to star 0 stars 0 watching About Files History Releases Proposed changes Issues For developers branch `main` Branches Tags History `CUDApp / tools / prof / stamp_oracle.c` 35 lines · 1005 bytes Raw Blame History 1 /* SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception */ 2 /* Differential oracle for emit_stamp in src/omega_gpu_cmdlist.c. 3 * Prints the six method words, one per line. It does not open a device. */ 4 #include 5 #include 6 #include 7 8 static uint32_t bw_mthd(uint32_t subc, uint32_t mthd, uint32_t count) { 9 return (2u << 28) | (count << 16) | (subc << 13) | (mthd >> 2); 10 } 11 12 int main(int argc, char **argv) { 13 unsigned long long va; 14 unsigned long long slot; 15 unsigned long long addr; 16 char *end = NULL; 17 if (argc != 3) { 18 return 2; 19 } 20 va = strtoull(argv[1], &end, 10); 21 if (end == argv[1] || *end != '\0') { 22 return 2; 23 } 24 slot = strtoull(argv[2], &end, 10); 25 if (end == argv[2] || *end != '\0') { 26 return 2; 27 } 28 addr = va + slot * 16ull; 29 printf("%u\n%llu\n0\n%u\n%u\n0\n", 30 bw_mthd(1u, 0x0158u, 5u), 31 slot, 32 (unsigned)addr, 33 (unsigned)(addr >> 32)); 34 return 0; 35 }