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 | .PHONY: test-gpu-conv2d test-gpu-conv2d-mutants test-gpu-conv2d-gemm-f32 |
| 3 | CONV2D_HOST_WRAP = -Wl,--wrap=omega_gpu_session_open,--wrap=omega_gpu_session_lock,--wrap=omega_gpu_session_unlock,--wrap=omega_gpu_session_free,--wrap=omega_gpu_session_alloc |
| 4 | $(OUT_DIR)/gpu_conv2d_test: tests/gpu_conv2d_test.c tests/gpu_conv2d_ref.h $(OUT_DIR)/libomega_gpu.a |
| 5 | $(CC) $(CFLAGS) -ffp-contract=off -Itests $(CONV2D_HOST_WRAP) -o $@ $< $(OUT_DIR)/libomega_gpu.a -lpthread -lm |
| 6 | test-gpu-conv2d: $(OUT_DIR)/gpu_conv2d_test |
| 7 | $< --sim |
| 8 | $< --shell-contract |
| 9 | # Converts .om through the bridge's seeded converter, which executes the pinned AArch64 omc. |
| 10 | CUDAPP_TARGET_ONLY_TESTS += $(if $(CUDAPP_OMC_HOST),,test-gpu-conv2d-mutants) |
| 11 | test-gpu-conv2d-mutants: $(OUT_DIR)/gpu_conv2d_test |
| 12 | @$(CUDAPP_REQUIRE_OMC) |
| 13 | sh tests/gpu_conv2d_mutants.sh |
| 14 | $(OUT_DIR)/gpu_conv2d_oracle_test: tests/gpu_conv2d_test.c tests/gpu_conv2d_ref.h src/omega_gpu_gemm.c $(OUT_DIR)/libomega_gpu.a |
| 15 | $(CC) $(CFLAGS) -ffp-contract=off -Itests $(CONV2D_HOST_WRAP) -UCUDAPP_MIGRATION_PENDING_C_GEMM_BUILDER -DCUDAPP_MIGRATION_PENDING_C_GEMM_BUILDER=1 -o $@ $< src/omega_gpu_gemm.c $(OUT_DIR)/libomega_gpu.a -lpthread -lm |
| 16 | test-gpu-conv2d-gemm-f32: $(OUT_DIR)/gpu_conv2d_test $(OUT_DIR)/gpu_conv2d_oracle_test |
| 17 | $(OUT_DIR)/gpu_conv2d_test --gemm-f32 > $(OUT_DIR)/conv2d-dense-seeded.log |
| 18 | $(OUT_DIR)/gpu_conv2d_oracle_test --gemm-f32 > $(OUT_DIR)/conv2d-dense-oracle.log |
| 19 | cmp $(OUT_DIR)/conv2d-dense-seeded.log $(OUT_DIR)/conv2d-dense-oracle.log |
| 20 | cat $(OUT_DIR)/conv2d-dense-seeded.log |
| 21 | CARRIED_HOST_TESTS += test-gpu-conv2d test-gpu-conv2d-mutants test-gpu-conv2d-gemm-f32 |
| 22 | |
| 23 | # Build-only operator executable. Never part of carried/headless targets. |
| 24 | $(OUT_DIR)/gpu_conv2d_chip_test: tests/gpu_conv2d_test.c tests/gpu_conv2d_ref.h $(OUT_DIR)/libomega_gpu.a |
| 25 | $(CC) $(CFLAGS) -ffp-contract=off -Itests -DCONV2D_OPERATOR_CHIP=1 -o $@ $< $(OUT_DIR)/libomega_gpu.a -lpthread -lm |