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 / mk / graph-residue.mk
| 1 | # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception |
| 2 | CARRIED_HOST_TESTS += test-graph-residue |
| 3 | GRAPH_RESIDUE_DEPS = tests/test_graph_residue.c examples/hello_gpu/hello_gpu.c src/omega_gpu_graph_residue.h src/cudapp_native.h $(OUT_DIR)/libomega_gpu.a |
| 4 | GRAPH_RESIDUE_FLAGS = $(filter-out -MMD -MP,$(CFLAGS)) -ffp-contract=off -Isrc |
| 5 | $(OUT_DIR)/graph-residue: $(GRAPH_RESIDUE_DEPS) |
| 6 | $(CC) $(GRAPH_RESIDUE_FLAGS) $< $(OUT_DIR)/libomega_gpu.a -lpthread -lm -o $@ |
| 7 | $(OUT_DIR)/graph-residue-oracle: $(GRAPH_RESIDUE_DEPS) |
| 8 | $(CC) $(GRAPH_RESIDUE_FLAGS) -O0 --coverage -DCUDAPP_MIGRATION_PENDING_GRAPH_RESIDUE=1 -DCUDAPP_MIGRATION_PENDING_HELLO_HOST=1 $< $(OUT_DIR)/libomega_gpu.a -lpthread -lm -o $@ |
| 9 | $(OUT_DIR)/graph-residue-red: $(GRAPH_RESIDUE_DEPS) |
| 10 | $(CC) $(GRAPH_RESIDUE_FLAGS) -DCUDAPP_GRAPH_DIFF_RED=1 $< $(OUT_DIR)/libomega_gpu.a -lpthread -lm -o $@ |
| 11 | .PHONY: test-graph-residue test-graph-residue-mutants |
| 12 | test-graph-residue: $(OUT_DIR)/graph-residue $(OUT_DIR)/graph-residue-oracle $(OUT_DIR)/graph-residue-red |
| 13 | $(OUT_DIR)/graph-residue > $(OUT_DIR)/graph-residue.log |
| 14 | $(OUT_DIR)/graph-residue-oracle > $(OUT_DIR)/graph-residue-oracle.log |
| 15 | cmp $(OUT_DIR)/graph-residue.log $(OUT_DIR)/graph-residue-oracle.log |
| 16 | $(OUT_DIR)/graph-residue-red > $(OUT_DIR)/graph-residue-red.log |
| 17 | @if cmp -s $(OUT_DIR)/graph-residue.log $(OUT_DIR)/graph-residue-red.log; then echo 'FAIL differential red check'; exit 1; fi |
| 18 | @echo 'PASS graph residue differential and red check' |
| 19 | test-graph-residue-mutants: $(OUT_DIR)/graph-residue $(OUT_DIR)/d8_mutants |
| 20 | OMEGA_OMC="$(OMEGA_OMC)" OMEGA_BRIDGE="$(OMEGA_BRIDGE)" CC="$(CC)" GRAPH_RESIDUE_FLAGS="$(GRAPH_RESIDUE_FLAGS)" OUT_DIR="$(OUT_DIR)" python3 om/graph/residue-mutants.py |
| 21 | OMEGA_OMC="$(OMEGA_OMC)" OMEGA_BRIDGE="$(OMEGA_BRIDGE)" $(OUT_DIR)/d8_mutants $(OUT_DIR) $(CC) $(GRAPH_RESIDUE_FLAGS) |
| 22 | $(OUT_DIR)/hello_gpu-oracle: examples/hello_gpu/hello_gpu.c src/cudapp_native.h $(OUT_DIR)/libomega_gpu.a |
| 23 | $(CC) $(GRAPH_RESIDUE_FLAGS) -O0 --coverage -DCUDAPP_MIGRATION_PENDING_HELLO_HOST=1 -DCUDAPP_MIGRATION_PENDING_HELLO_CONTROL=1 $< $(OUT_DIR)/libomega_gpu.a -lpthread -lm -o $@ |
| 24 | .PHONY: test-graph-residue-coverage |
| 25 | test-graph-residue-coverage: test-graph-residue $(OUT_DIR)/hello_gpu-oracle |
| 26 | $(OUT_DIR)/hello_gpu-oracle --sim > $(OUT_DIR)/hello-oracle-sim.log |
| 27 | @for bug in past-end short; do $(OUT_DIR)/hello_gpu-oracle --sim --bug=$$bug > $(OUT_DIR)/hello-oracle-$$bug.log; rc=$$?; test $$rc = 1 || exit 1; done |
| 28 | gcov -b -c -o $(OUT_DIR)/graph-residue-oracle-test_graph_residue.gcno tests/test_graph_residue.c |
| 29 | gcov -b -c -o $(OUT_DIR)/hello_gpu-oracle-hello_gpu.gcno examples/hello_gpu/hello_gpu.c |
| 30 | |
| 31 | .PHONY: test-graph-table-perm |
| 32 | CARRIED_HOST_TESTS += test-graph-table-perm |
| 33 | # Both graph mutant runners convert .om through the bridge's seeded converter (pinned AArch64 omc). |
| 34 | CUDAPP_TARGET_ONLY_TESTS += $(if $(CUDAPP_OMC_HOST),,test-graph-table-perm test-graph-headscale) |
| 35 | test-graph-table-perm: |
| 36 | @$(CUDAPP_REQUIRE_OMC) |
| 37 | OMEGA_OMC="$(OMEGA_OMC)" OMEGA_BRIDGE="$(OMEGA_BRIDGE)" CC="$(CC)" python3 om/graph/table-mutants.py |
| 38 | |
| 39 | .PHONY: test-graph-headscale |
| 40 | CARRIED_HOST_TESTS += test-graph-headscale |
| 41 | test-graph-headscale: |
| 42 | @$(CUDAPP_REQUIRE_OMC) |
| 43 | OMEGA_OMC="$(OMEGA_OMC)" OMEGA_BRIDGE="$(OMEGA_BRIDGE)" CC="$(CC)" python3 om/graph/headscale-mutants.py |