diff --git a/Makefile b/Makefile index af08a59..84a3dec 100644 --- a/Makefile +++ b/Makefile @@ -102,7 +102,7 @@ ROOFLINE ?= 0 CXXFLAGS += -DROOFLINE=$(ROOFLINE) # Benchmark suite parameters. -BENCH_SIZES ?= 50 100 200 500 1000 +BENCH_SIZES ?= 50 100 200 500 1000 2000 5000 BENCH_ITER ?= 1000 # Verification parameters diff --git a/scripts/measure.sh b/scripts/measure.sh new file mode 100755 index 0000000..5aa25d0 --- /dev/null +++ b/scripts/measure.sh @@ -0,0 +1,52 @@ +#!/bin/bash + +set -e + +echo "Disabling frequency scaling..." +if [ -f "scripts/disable-frequency-scaling.sh" ]; then + bash scripts/disable-frequency-scaling.sh +else + echo "Warning: scripts/disable-frequency-scaling.sh not found. Skipping." +fi + +ARCH="x86" +if uname -m | grep -q "arm\|aarch64"; then + ARCH="arm" +fi +echo "Detected architecture: $ARCH" + +echo "Starting benchmark suite (3 runs per variant)..." + +for variant_file in variants/variant_*.cpp; do + filename=$(basename "$variant_file") + + base_name="${filename#variant_}" + base_name="${base_name%.cpp}" + + log_dir="measurements/variant_${base_name}/${ARCH}" + + mkdir -p "$log_dir" + + echo "--- Processing ${filename} (Base: ${base_name}) ---" + + for run in 1 2 3; do + log_file="${log_dir}/${run}.log" + + if [ -f "$log_file" ]; then + echo " Skipping run ${run}: ${log_file} already exists." + continue + fi + + echo " Running benchmark ${run}/3 for ${filename}..." + + VARIANT="$base_name" make bench-suite >"$log_file" + + if [ $? -eq 0 ]; then + echo " Success: Run ${run} completed." + else + echo " Error in run ${run} for ${filename}. Check ${log_file}." + fi + done +done + +echo "Benchmark suite completed."