2022-11-16 16:39:09 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
2022-11-17 01:59:31 +00:00
|
|
|
run_benchmarks() {
|
|
|
|
runs=25
|
|
|
|
totalt=0.0
|
2022-11-16 16:39:09 +00:00
|
|
|
|
2022-11-17 01:59:31 +00:00
|
|
|
for i in $(seq $runs)
|
|
|
|
do
|
2022-11-28 14:08:26 +00:00
|
|
|
exet=$(./atax.elf)
|
2022-11-17 01:59:31 +00:00
|
|
|
totalt=$(awk "BEGIN{print $totalt+$exet}")
|
2022-11-17 02:02:20 +00:00
|
|
|
echo -n "."
|
2022-11-17 01:59:31 +00:00
|
|
|
# echo "Run #$i: " $(awk "BEGIN{printf(\"%.3g\", $exet)}") "seconds"
|
|
|
|
done
|
|
|
|
|
|
|
|
avgt=$(awk "BEGIN{print $totalt/$runs}")
|
|
|
|
echo " Average of $runs runs: " $(awk "BEGIN{printf(\"%.3g\", $avgt)}") "seconds"
|
|
|
|
}
|
|
|
|
|
2022-11-17 13:58:32 +00:00
|
|
|
for dataset in MINI_DATASET SMALL_DATASET STANDARD_DATASET LARGE_DATASET EXTRALARGE_DATASET
|
2022-11-16 16:39:09 +00:00
|
|
|
do
|
2022-11-30 22:43:32 +00:00
|
|
|
for c in $(seq 0 7)
|
2022-11-17 13:58:32 +00:00
|
|
|
do
|
2022-11-28 13:37:37 +00:00
|
|
|
cxxflags="-D$dataset"
|
2022-11-17 01:59:31 +00:00
|
|
|
|
2022-11-17 13:58:32 +00:00
|
|
|
if (( $c & 1 ))
|
|
|
|
then
|
2022-11-30 22:43:32 +00:00
|
|
|
cxxflags="$cxxflags -DHPC_INCLUDE_INIT"
|
2022-11-17 13:58:32 +00:00
|
|
|
fi
|
2022-11-17 01:59:31 +00:00
|
|
|
|
2022-11-17 13:58:32 +00:00
|
|
|
if (( $c & 2 ))
|
|
|
|
then
|
2022-11-30 22:43:32 +00:00
|
|
|
cxxflags="$cxxflags -DHPC_USE_CUDA"
|
|
|
|
fi
|
|
|
|
|
|
|
|
if (( $c & 2 ))
|
|
|
|
then
|
|
|
|
cxxflags="$cxxflags -DHPC_USE_STRIDE"
|
2022-11-30 14:09:26 +00:00
|
|
|
fi
|
2022-11-17 01:59:31 +00:00
|
|
|
|
2022-11-28 13:37:37 +00:00
|
|
|
echo "Flags: $cxxflags"
|
2022-11-28 14:08:26 +00:00
|
|
|
make --silent "EXTRA_CXXFLAGS=$cxxflags" "atax.elf"
|
2022-11-16 16:39:09 +00:00
|
|
|
|
2022-11-17 13:58:32 +00:00
|
|
|
run_benchmarks
|
|
|
|
done
|
2022-11-17 01:59:31 +00:00
|
|
|
done
|