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 / attention-mirror.mk
| 1 | # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception |
| 2 | CARRIED_HOST_TESTS += test-attention-mirror-policy |
| 3 | .PHONY: test-attention-mirror-policy |
| 4 | $(OUT_DIR)/attention-mirror-policy.so: src/cudapp_om_attn_mirror_plan.c src/cudapp_om_attn_mirror_step.c |
| 5 | @mkdir -p $(OUT_DIR) |
| 6 | $(CC) $(filter-out -MMD -MP,$(CFLAGS)) -shared -fPIC $^ -o $@ |
| 7 | test-attention-mirror-policy: $(OUT_DIR)/attention-mirror-policy.so |
| 8 | python3 om/attention-mirror/check.py $(abspath $(OUT_DIR))/attention-mirror-policy.so |
| 9 | ifeq ($(CUDAPP_OMC_HOST),1) |
| 10 | OMEGA_OMC="$(OMEGA_OMC)" OMEGA_BRIDGE="$(OMEGA_BRIDGE)" CC="$(CC)" python3 om/attention-mirror/mutants.py |
| 11 | endif |
| 12 | |
| 13 | CARRIED_HOST_TESTS += test-attention-mirror-dispatch |
| 14 | .PHONY: test-attention-mirror-dispatch |
| 15 | ATTN_MIRROR_WRAP = omega_gpu_session_lock omega_gpu_session_unlock omega_gpu_session_open omega_gpu_session_on_close omega_gpu_decode_attn256_cache_view omega_gpu_session_sync_to_gpu omega_gpu_session_sync_to_cpu omega_gpu_session_free omega_gpu_pf_alloc_dev_locked omega_gpu_pf_copy_va_locked omega_gpu_session_launch |
| 16 | $(OUT_DIR)/attention-mirror-dispatch: om/attention-mirror/dispatch-check.c src/omega_gpu_prefill_attn256_api.c $(OUT_DIR)/libomega_gpu.a |
| 17 | $(CC) $(CFLAGS) -o $@ $< $(OUT_DIR)/libomega_gpu.a $(foreach f,$(ATTN_MIRROR_WRAP),-Wl,--wrap=$(f)) -lpthread -lm |
| 18 | test-attention-mirror-dispatch: $(OUT_DIR)/attention-mirror-dispatch |
| 19 | $(abspath $(OUT_DIR))/attention-mirror-dispatch |
| 20 | CC="$(CC)" python3 om/attention-mirror/dispatch-mutants.py $(abspath $(OUT_DIR))/libomega_gpu.a |