class v6 kit: the two-pack emulation runner builds each orientation in its own dir
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
parent
98bfa772c4
commit
aff18123c5
1 changed files with 9 additions and 12 deletions
|
|
@ -10,21 +10,18 @@ R="$1"; A="$2"; B="$3"; L="${4:-emu-two-packs}"
|
|||
T=$(mktemp -d /tmp/v6-emu.XXXXXX); E="$T/emu"; mkdir -p "$E"
|
||||
cd "$R"
|
||||
for p in "$A" "$B"; do echo "PACK $(basename "$p") id $(grep -oE 'IGNEUM_PROGRAM_ID 0x[0-9a-f]+' "$p/program.h" | head -1 | awk '{print $2}') generator $(grep -oE 'IGNEUM_GENERATOR [0-9]+' "$p/program.h" | awk '{print $2}') class $(grep -oE 'IGNEUM_LOAD_CLASS "[^"]+"' "$p/program.h" | cut -d'"' -f2)"; done
|
||||
emu_kernel() { { echo '#include <cuda_runtime.h>'; echo '#include <cstdint>'; echo "namespace $2 {"; sed -E 's/([A-Za-z_0-9]+)<<<([^,]+), ([^>]+)>>>\(/emu_launch(\1, \2, \3, /' "$1/$3.cu"; echo "}"; } > "$E/$3_$2.cpp"; g++ -std=c++17 -O2 -w -I proto-cuda/emu -I "$1" -c "$E/$3_$2.cpp" -o "$E/$3_$2.o"; }
|
||||
emu_kernel "$A" emu_pack_a kernel && emu_kernel "$A" emu_pack_a kernel_bound && emu_kernel "$B" emu_pack_b kernel && emu_kernel "$B" emu_pack_b kernel_bound \
|
||||
&& g++ -std=c++17 -O2 -Wall -Wextra -DIGNEUM_EMU -I proto-cuda/nvrtc -I /usr/local/cuda/include -c proto-cuda/nvrtc/worker.cpp -o "$E/worker.o" \
|
||||
&& g++ -std=c++17 -O2 -Wall -Wextra -DIGNEUM_EMU -DIGNEUM_EMU_TWO_PACKS -I proto-cuda/nvrtc -I proto-cuda/emu -I /usr/local/cuda/include -c proto-cuda/nvrtc/emu/emu_backend.cpp -o "$E/emu_backend.o" \
|
||||
&& g++ -std=c++17 -O2 -w -I proto-cuda/emu -c proto-cuda/emu/shim.cpp -o "$E/shim.o" \
|
||||
&& g++ -o "$E/igneum-worker-cuda-emu" "$E"/*.o -pthread 2> "$T/emu-build.log" || { echo "FAIL emu build"; head -30 "$T/emu-build.log"; exit 1; }
|
||||
run_check() { # <pack dir as A> <other as B> <name>
|
||||
build_and_check() { # <pack dir as A> <pack dir as B> <name>: one emulation build per orientation in its own dir
|
||||
local ed="$T/emu-$3"; mkdir -p "$ed"
|
||||
cp "$E"/worker.o "$E"/emu_backend.o "$E"/shim.o "$ed"/ 2>/dev/null
|
||||
( cd "$ed" && E="$ed" emu_kernel "$1" emu_pack_a kernel && E="$ed" emu_kernel "$1" emu_pack_a kernel_bound && E="$ed" emu_kernel "$2" emu_pack_b kernel && E="$ed" emu_kernel "$2" emu_pack_b kernel_bound ) >/dev/null 2>&1
|
||||
g++ -o "$ed/igneum-worker-cuda-emu" "$ed"/*.o -pthread 2>> "$T/emu-build.log" || { echo "FAIL emu link $3"; return 1; }
|
||||
emu_kernel() { { echo '#include <cuda_runtime.h>'; echo '#include <cstdint>'; echo "namespace $2 {"; sed -E 's/([A-Za-z_0-9]+)<<<([^,]+), ([^>]+)>>>\(/emu_launch(\1, \2, \3, /' "$1/$3.cu"; echo "}"; } > "$ed/$3_$2.cpp"; g++ -std=c++17 -O2 -w -I proto-cuda/emu -I "$1" -c "$ed/$3_$2.cpp" -o "$ed/$3_$2.o"; }
|
||||
emu_kernel "$1" emu_pack_a kernel && emu_kernel "$1" emu_pack_a kernel_bound && emu_kernel "$2" emu_pack_b kernel && emu_kernel "$2" emu_pack_b kernel_bound \
|
||||
&& g++ -std=c++17 -O2 -w -DIGNEUM_EMU -I proto-cuda/nvrtc -I /usr/local/cuda/include -c proto-cuda/nvrtc/worker.cpp -o "$ed/worker.o" \
|
||||
&& g++ -std=c++17 -O2 -w -DIGNEUM_EMU -DIGNEUM_EMU_TWO_PACKS -I proto-cuda/nvrtc -I proto-cuda/emu -I /usr/local/cuda/include -c proto-cuda/nvrtc/emu/emu_backend.cpp -o "$ed/emu_backend.o" \
|
||||
&& g++ -std=c++17 -O2 -w -I proto-cuda/emu -c proto-cuda/emu/shim.cpp -o "$ed/shim.o" \
|
||||
&& g++ -o "$ed/igneum-worker-cuda-emu" "$ed"/*.o -pthread 2> "$T/emu-build-$3.log" || { echo "FAIL emu build $3"; head -20 "$T/emu-build-$3.log"; return 1; }
|
||||
/srv/builds/_bin/lease pool 32 --label "$L: $3" --owner class-v5 --class v5 --min 8 -- env IGNEUM_EMU_PACK="$1" IGNEUM_EMU_PACK2="$2" timeout 2400 "$ed/igneum-worker-cuda-emu" --check --pack "$1" > "$T/$3.log" 2>&1
|
||||
echo "RC $3 $?"
|
||||
grep -E '^check (PASS|FAIL)|self-test|fingerprint|FAIL|error' "$T/$3.log" | grep -vE "^lease:" | cut -c1-320
|
||||
}
|
||||
run_check "$A" "$B" "$(basename "$A")"
|
||||
run_check "$B" "$A" "$(basename "$B")"
|
||||
build_and_check "$A" "$B" "$(basename "$A")"
|
||||
build_and_check "$B" "$A" "$(basename "$B")"
|
||||
echo "logs under $T"
|
||||
|
|
|
|||
Loading…
Reference in a new issue