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/regalloc_om/sim_ge.sh # 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 / regalloc_om / sim_ge.sh` 41 lines · 2119 bytes Raw Blame History 1 #!/bin/sh 2 # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 3 # Run inside the device-free bwrap namespace, like every host/simulator gate. 4 set -eu 5 ROOT=$(CDPATH= cd -- "$(dirname "$0")/../.." && pwd) 6 cd "$ROOT" 7 : "${CC:=cc}" 8 : "${SIM_GE_OUT:=$ROOT/build/regalloc-om/signed-ge}" 9 mkdir -p "$SIM_GE_OUT/mutant" 10 FLAGS="-std=gnu11 -O2 -Wall -Wextra -Werror -Wno-unused-function -ffp-contract=off -ffunction-sections -fdata-sections -Isrc -I$ROOT/build/regalloc-om/include" 11 ORACLE="-DCUDAPP_MIGRATION_PENDING_C_REGALLOC -DCUDAPP_MIGRATION_PENDING_C_CODEGEN_MATMUL -DCUDAPP_MIGRATION_PENDING_C_ENCODER -DCUDAPP_MIGRATION_PENDING_C_BIND" 12 SOURCES="tests/regalloc_om/sim.c src/omega_blackwell_codegen.c src/omega_blackwell_matmul.c src/omega_blackwell_encoder.c src/sha256.c src/cudapp_om_bw_enc_sm121.c src/cudapp_freest_f16.c" 13 $CC $FLAGS $ORACLE -Itests $SOURCES -Wl,--gc-sections -lm -o "$SIM_GE_OUT/baseline" 14 "$SIM_GE_OUT/baseline" >"$SIM_GE_OUT/baseline.log" 2>&1 15 cat "$SIM_GE_OUT/baseline.log" 16 python3 - "$SIM_GE_OUT/mutant/bw_warp_sim_tc.h" <<'PY' 17 import pathlib,sys 18 source=pathlib.Path('tests/bw_warp_sim_tc.h').read_text() 19 old='case BW_IR_ISETP_GE: l->p0 = (int32_t)a >= (in->src2_vreg >= 0 ? (int32_t)b : (int32_t)in->imm); break;' 20 new='case BW_IR_ISETP_GE: l->p0 = a >= (in->src2_vreg >= 0 ? b : in->imm); break;' 21 if source.count(old) != 1: 22 raise SystemExit('FAIL unsigned mutant site not unique') 23 pathlib.Path(sys.argv[1]).write_text(source.replace(old,new)) 24 PY 25 $CC $FLAGS $ORACLE -I"$SIM_GE_OUT/mutant" -Itests $SOURCES -Wl,--gc-sections -lm -o "$SIM_GE_OUT/unsigned-mutant" 26 set +e 27 "$SIM_GE_OUT/unsigned-mutant" >"$SIM_GE_OUT/unsigned-mutant.log" 2>&1 28 rc=$? 29 set -e 30 if [ "$rc" -ne 1 ]; then 31 cat "$SIM_GE_OUT/unsigned-mutant.log" 32 echo "FAIL unsigned GE mutant exercise=$rc expected=1" 33 exit 1 34 fi 35 if ! grep -q '^FAIL signed GE ' "$SIM_GE_OUT/unsigned-mutant.log"; then 36 cat "$SIM_GE_OUT/unsigned-mutant.log" 37 echo 'FAIL unsigned GE mutant failed for an unrelated reason' 38 exit 1 39 fi 40 cat "$SIM_GE_OUT/unsigned-mutant.log" 41 echo 'PASS unsigned GE semantic mutant KILLED compile=0 exercise=1'