#!/bin/bash
set -euo pipefail
source .env
for spec in '5 native automatic' '128 packed automatic'; do
  read -r rows packing memory <<< "$spec"
  out="artifacts/gemm-utilization-20260913/check-r${rows}-${packing}-${memory}"
  mkdir -p "$out"
  RAYON_NUM_THREADS=4 RUST_LOG=info target/release/ipu-trivial-test "$IPU_CONFIG" --sdk "$POPLAR_SDK_ENABLED" --runtime-source device/static_runtime.S --workload gemm-benchmark --tiles 64 --benchmark-rows "$((rows * 64))" --benchmark-inner 64 --benchmark-columns 64 --optimization-steps 0 --gemm-output-packing "$packing" --reference-run --profile-output "$out/model.capnp" --device-lock artifacts/layout-sweep/device.lock --package "$out/model.ipuexe" > "$out/run.log" 2>&1
  echo "$spec PASS"
done
