interplane.Get Omega
Read in your language

omega-blas

aien-dev/omega-blas

Brought by drakestapleton

branch main Branches Tags History

omega-blas / tests / gb10 / run.sh

23 lines · 1258 bytes Raw Blame History
1#!/bin/sh
2# tests/gb10/run.sh: build and run tests/gb10/batched.c (strided, pointer-array and single f32
3# products, the epilogue and non-f32 calls that must stay on the host) against one library build.
4# OMB_BUILD=<dir> library directory (default build-gb10; build for the host-only library)
5# OMEGABLAS_DEVICE=gb10 run on the device path (unset: host); the route predictions follow it
6# GB10_HOOKS=<CUDApp> link tests/gb10/hooks.c (OMB_TEST_BACKEND=model, OMB_TEST_MUTANT=<n>)
7# Exit status is the driver's: 0 only if every case is inside its derived limit, leaves every
8# element outside the products alone, and moves the route counters as predicted.
9set -eu
10ROOT=$(cd "$(dirname "$0")/../.." && pwd)
11CC=${CC:-cc}
12OMB_BUILD=$(cd "$ROOT" && cd "${OMB_BUILD:-build-gb10}" && pwd)
13W="$OMB_BUILD/gb10test"
14rm -rf "$W"; mkdir -p "$W"
15HOOKS=
16if [ -n "${GB10_HOOKS:-}" ]; then
17 $CC -O1 -I"$GB10_HOOKS/src" -I"$GB10_HOOKS/tests" -c -o "$W/hooks.o" "$ROOT/tests/gb10/hooks.c"
18 HOOKS="$W/hooks.o"
19fi
20$CC -O1 -Wall -I"$ROOT/include" -o "$W/batched" "$ROOT/tests/gb10/batched.c" $HOOKS \
21 -L"$OMB_BUILD" -lomegablas -Wl,-rpath,"$OMB_BUILD" -lm
22echo "gb10 batched: library $OMB_BUILD/libomegablas.so, device ${OMEGABLAS_DEVICE:-host}"
23"$W/batched"