Merge branch 'elliot/measure.sh' into 'main'
Added measurement script See merge request course-asl-fastcode26/team70!33
This commit is contained in:
@@ -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
|
||||
|
||||
Executable
+52
@@ -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."
|
||||
Reference in New Issue
Block a user