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/tests/codegen_pf_diff.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 / tests / codegen_pf_diff.c` 25 lines · 1132 bytes Raw Blame History 1 /* SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception */ 2 #include "omega_blackwell_codegen_pf.h" 3 #include 4 #include 5 6 static int same(const BlackwellIRProgram *a, const BlackwellIRProgram *b) { 7 if (a->count != b->count) return 0; 8 if (a->regalloc.num_vregs != b->regalloc.num_vregs) return 0; 9 if (a->regalloc.num_uvregs != b->regalloc.num_uvregs) return 0; 10 for (size_t i = 0; i < a->count; i++) { 11 if (memcmp(&a->insns[i], &b->insns[i], sizeof a->insns[i]) != 0) return 0; 12 } 13 return 1; 14 } 15 16 int main(void) { 17 BlackwellIRProgram c, o, m; 18 if (omega_blackwell_codegen_pf_copy_prog_c(&c) != 0) { printf("FAIL c build\n"); return 1; } 19 if (omega_cg_pf_copy_from_omega(&o, 0) != 0) { printf("FAIL omega build\n"); return 1; } 20 if (!same(&c, &o)) { printf("FAIL bytes c=%zu o=%zu\n", c.count, o.count); return 1; } 21 if (omega_cg_pf_copy_from_omega(&m, 1) != 0) { printf("FAIL mutant build\n"); return 1; } 22 if (same(&c, &m)) { printf("FAIL mutant not caught\n"); return 1; } 23 printf("PASS pf copy byte-identical insns=%zu mutant caught\n", c.count); 24 return 0; 25 }