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 / tests / api_shells_run.sh
| 1 | #!/bin/bash |
| 2 | # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception |
| 3 | # Focused host differential for the kernel-family API shells. No GPU. |
| 4 | set -euo pipefail |
| 5 | ROOT="$(cd "$(dirname "$0")/.." && pwd)" |
| 6 | cd "$ROOT" |
| 7 | OUT="${OUT_DIR:-$ROOT/build/api-shells}" |
| 8 | GEN="${API_SHELLS_GEN:-$ROOT/src}" |
| 9 | mkdir -p "$OUT" |
| 10 | if [[ "${1:-}" == "regen" ]]; then |
| 11 | export OMEGA_OMC="${OMEGA_OMC:-$HOME/work/cudastack/omega-mv/seed/out/omc}" |
| 12 | export OMEGA_BRIDGE="${OMEGA_BRIDGE:-$HOME/work/cudastack/omega-bridge}" |
| 13 | units=() |
| 14 | for name in shp pack slot blk trit; do |
| 15 | source_file="om/api/apish_$name.om" |
| 16 | if [[ "${API_SHELLS_MUTANT:-}" == */"apish_$name.om" ]]; then |
| 17 | source_file="$API_SHELLS_MUTANT" |
| 18 | fi |
| 19 | units+=("$source_file") |
| 20 | done |
| 21 | export OMEGA_UNITS="${units[*]}" |
| 22 | export OMEGA_UNITS_DEST="$OUT/gen" |
| 23 | mkdir -p "$OMEGA_UNITS_DEST" |
| 24 | bash om/units.sh |
| 25 | GEN="$OMEGA_UNITS_DEST" |
| 26 | fi |
| 27 | cc -std=c11 -O2 -ffp-contract=off -I"$ROOT/src" -c "$ROOT/tests/api_shells_oracle.c" -o "$OUT/oracle.o" |
| 28 | cc -std=c11 -O2 -ffp-contract=off -I"$ROOT/src" -c "$ROOT/tests/api_shells_diff.c" -o "$OUT/diff.o" |
| 29 | cc -std=c11 -O2 -ffp-contract=off -I"$ROOT/src" -c "$ROOT/src/omega_fp8_slot_table.c" -o "$OUT/slot_table.o" |
| 30 | cc -std=c11 -O2 -ffp-contract=off -I"$ROOT/src" -c "$ROOT/src/omega_gpu_fp8_pack.c" -o "$OUT/gpu_pack.o" |
| 31 | for name in shp pack slot blk trit; do |
| 32 | cc -std=c11 -O2 -ffp-contract=off -I"$ROOT/src" -c "$GEN/cudapp_om_apish_$name.c" -o "$OUT/unit_$name.o" |
| 33 | done |
| 34 | for name in nan scale fold foldh acc mag slot idle pad; do |
| 35 | cc -std=c11 -O2 -ffp-contract=off -I"$ROOT/src" -c "$ROOT/src/cudapp_om_ar_$name.c" -o "$OUT/ar_$name.o" |
| 36 | done |
| 37 | for name in fp8x fp8xb; do |
| 38 | cc -std=c11 -O2 -ffp-contract=off -I"$ROOT/src" -c "$ROOT/src/cudapp_om_av_$name.c" -o "$OUT/av_$name.o" |
| 39 | done |
| 40 | cc -o "$OUT/api_shells_diff" \ |
| 41 | "$OUT/diff.o" "$OUT/oracle.o" "$OUT/slot_table.o" "$OUT/gpu_pack.o" \ |
| 42 | "$OUT/unit_shp.o" "$OUT/unit_pack.o" "$OUT/unit_slot.o" "$OUT/unit_blk.o" "$OUT/unit_trit.o" \ |
| 43 | "$OUT/ar_nan.o" "$OUT/ar_scale.o" "$OUT/ar_fold.o" "$OUT/ar_foldh.o" "$OUT/ar_acc.o" "$OUT/ar_mag.o" \ |
| 44 | "$OUT/ar_slot.o" "$OUT/ar_idle.o" "$OUT/ar_pad.o" \ |
| 45 | "$OUT/av_fp8x.o" "$OUT/av_fp8xb.o" \ |
| 46 | -lpthread -lm |
| 47 | "$OUT/api_shells_diff" |