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 | # Bar C3 (GpuStack PLAN): build rules for the C3 tests carried from omega-mv main e5b32567 (C3 work first landed on |
| 3 | # omega-mv c3/gemm a7d6463b9; src/omega_numeric* are the e5b32567 blobs). |
| 4 | # test-gpu-scan / test-gpu-gemm run the host and warp-simulator tiers; the chip tier is the binary with |
| 5 | # no flag, under `flock -w 900 /tmp/aien-gb10.lock`. |
| 6 | GPU_SCAN_TEST = $(OUT_DIR)/gpu_scan_test |
| 7 | $(GPU_SCAN_TEST): tests/gpu_scan_test.c tests/bw_warp_sim.h src/omega_gpu_scan.h src/omega_numeric_reduce.c src/omega_numeric.c $(NUMERIC_DEPS) $(OUT_DIR)/libomega_gpu.a |
| 8 | $(CC) $(CFLAGS) $(CUDAPP_NUMERIC_DEFS) -ffp-contract=off -Itests -o $@ tests/gpu_scan_test.c src/omega_numeric_reduce.c src/omega_numeric.c $(OUT_DIR)/libomega_gpu.a -lpthread -lm |
| 9 | GPU_GEMM_TEST = $(OUT_DIR)/gpu_gemm_test |
| 10 | $(GPU_GEMM_TEST): tests/gpu_gemm_test.c tests/bw_warp_sim_tc.h tests/bw_hmma_model.h tests/bw_qmma_model.h src/omega_gpu_gemm.h $(OUT_DIR)/libomega_gpu.a |
| 11 | $(CC) $(CFLAGS) -ffp-contract=off -Itests -o $@ tests/gpu_gemm_test.c $(OUT_DIR)/libomega_gpu.a -lpthread -lm |
| 12 | GPU_TILELAB_TEST = $(OUT_DIR)/gpu_tilelab_test |
| 13 | $(GPU_TILELAB_TEST): tests/gpu_tilelab_test.c src/omega_gpu_gemm.h src/omega_gpu_session.h $(OUT_DIR)/libomega_gpu.a |
| 14 | $(CC) $(CFLAGS) -ffp-contract=off -Itests -o $@ tests/gpu_tilelab_test.c $(OUT_DIR)/libomega_gpu.a -lpthread -lm |
| 15 | TILELAB_OMC ?= $(OMEGA_MV)/seed/out/omc |
| 16 | TILELAB_HOST_FAULT = $(OUT_DIR)/gpu_tilelab_host_fault |
| 17 | TILELAB_FAULT_GATE = $(OUT_DIR)/tilelab_host_fault |
| 18 | TILELAB_REPLAY = $(OUT_DIR)/tilelab_replay |
| 19 | |
| 20 | # The fault binary compiles out device/session calls; the .om conductor invokes no shell. |
| 21 | $(TILELAB_HOST_FAULT): tests/gpu_tilelab_test.c src/omega_gpu_gemm.h src/omega_gpu_session.h $(OUT_DIR)/libomega_gpu.a |
| 22 | $(CC) $(CFLAGS) -ffp-contract=off -DTILELAB_HOST_FAULT -Itests -o $@ tests/gpu_tilelab_test.c $(OUT_DIR)/libomega_gpu.a -lpthread -lm |
| 23 | .PHONY: tilelab-compiler-check test-gpu-scan test-gpu-gemm test-tilelab-host tilelab-replay |
| 24 | tilelab-compiler-check: |
| 25 | @test -x "$(TILELAB_OMC)" || { echo "NOT_RUN: set TILELAB_OMC to the tools/c5/omc.pin compiler"; exit 3; } |
| 26 | @read repo rev unit hash < tools/c5/omc.pin; printf '%s %s\n' "$$hash" "$(TILELAB_OMC)" | sha256sum -c - |
| 27 | $(TILELAB_FAULT_GATE): tools/tilelab_process.om tests/tilelab_host_fault.om | tilelab-compiler-check |
| 28 | @mkdir -p $(OUT_DIR) |
| 29 | cat tools/tilelab_process.om tests/tilelab_host_fault.om > $@.om |
| 30 | $(TILELAB_OMC) < $@.om > $@.tmp |
| 31 | chmod +x $@.tmp |
| 32 | mv $@.tmp $@ |
| 33 | $(TILELAB_REPLAY): tools/tilelab_process.om tools/tilelab_replay.om | tilelab-compiler-check |
| 34 | @mkdir -p $(OUT_DIR) |
| 35 | cat tools/tilelab_process.om tools/tilelab_replay.om > $@.om |
| 36 | $(TILELAB_OMC) < $@.om > $@.tmp |
| 37 | chmod +x $@.tmp |
| 38 | mv $@.tmp $@ |
| 39 | tilelab-replay: $(TILELAB_REPLAY) |
| 40 | test-gpu-scan: $(GPU_SCAN_TEST) |
| 41 | ./$(GPU_SCAN_TEST) --sim |
| 42 | test-gpu-gemm: $(GPU_GEMM_TEST) |
| 43 | ./$(GPU_GEMM_TEST) --sim |
| 44 | test-tilelab-host: $(GPU_TILELAB_TEST) $(TILELAB_HOST_FAULT) $(TILELAB_FAULT_GATE) $(TILELAB_REPLAY) |
| 45 | ./$(GPU_TILELAB_TEST) --host-only |
| 46 | ./$(TILELAB_FAULT_GATE) ./$(TILELAB_HOST_FAULT) ./$(TILELAB_REPLAY) "$$(mktemp -u -d $(OUT_DIR)/tilelab-host.XXXXXXXX)" |