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
| 1 | # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception |
| 2 | # Host-only tests of the m16 wait primitive (from the physics repository Makefile). No GPU. |
| 3 | M16_CFLAGS ?= -O2 -Wall -Wextra -Werror |
| 4 | BUILD := build/m16_gpu_wait |
| 5 | |
| 6 | .PHONY: test-m16-gpu-wait mutants-m16-gpu-wait host-tests-m16 |
| 7 | |
| 8 | host-tests-m16: test-m16-gpu-wait mutants-m16-gpu-wait |
| 9 | |
| 10 | # m16_gpu_wait.c takes its failure class and wait verdicts from om/engine/eng.om (src/cudapp_om_eng.c). |
| 11 | $(BUILD)/test_real: tests/test_m16_gpu_wait.c m16/m16_gpu_wait.c m16/m16_gpu_wait.h src/cudapp_om_eng.c src/omega_eng_dec.h src/omega_fixture_rest.h |
| 12 | @mkdir -p $(BUILD) |
| 13 | $(CC) $(M16_CFLAGS) -I m16 -I src tests/test_m16_gpu_wait.c m16/m16_gpu_wait.c src/cudapp_om_eng.c -o $@ |
| 14 | |
| 15 | test-m16-gpu-wait: $(BUILD)/test_real |
| 16 | $(BUILD)/test_real |
| 17 | |
| 18 | # Three one-line compile-flag mutants of the REAL primitive. Each must make the |
| 19 | # host test fail, and fail in the scenario named for it. A surviving mutant |
| 20 | # fails this target. |
| 21 | # STALL_NEVER_RESETS killed by progress_resets_idle |
| 22 | # PROGRESS_EXTENDS_HARD killed by hard_deadline_with_progress |
| 23 | # NO_BARRIER killed by barrier_before_read |
| 24 | MUTANTS := STALL_NEVER_RESETS:progress_resets_idle \ |
| 25 | PROGRESS_EXTENDS_HARD:hard_deadline_with_progress \ |
| 26 | NO_BARRIER:barrier_before_read |
| 27 | |
| 28 | mutants-m16-gpu-wait: |
| 29 | @mkdir -p $(BUILD) |
| 30 | @set -e; for m in $(MUTANTS); do \ |
| 31 | flag=$${m%%:*}; scen=$${m##*:}; \ |
| 32 | $(CC) $(M16_CFLAGS) -DM16_GPU_WAIT_MUT_$$flag -I m16 -I src tests/test_m16_gpu_wait.c m16/m16_gpu_wait.c src/cudapp_om_eng.c -o $(BUILD)/mut_$$flag; \ |
| 33 | if $(BUILD)/mut_$$flag > $(BUILD)/mut_$$flag.log 2>&1; then echo "MUTANT $$flag SURVIVED (test passed)"; exit 1; fi; \ |
| 34 | if ! grep -Eq "^real +$$scen +FAIL" $(BUILD)/mut_$$flag.log; then echo "MUTANT $$flag died but not in $$scen"; cat $(BUILD)/mut_$$flag.log; exit 1; fi; \ |
| 35 | echo "MUTANT $$flag killed by $$scen"; \ |
| 36 | done |
| 37 | @echo "M16_GPU_WAIT_MUTANTS PASS (3/3 killed)" |