aboutsummaryrefslogtreecommitdiff
path: root/benchmark/benchmark.sh
diff options
context:
space:
mode:
authorSebastiano Tronto <sebastiano@tronto.net>2024-06-13 22:28:49 +0200
committerSebastiano Tronto <sebastiano@tronto.net>2024-06-13 22:28:49 +0200
commitc04a283a7ab97903683f5f7268068aef69f5bddf (patch)
tree9809c4a71c2ad1a5123371c32c34f03b1b703ecf /benchmark/benchmark.sh
parent7812684339d03f6993882358b0045c1bc2d5032c (diff)
downloadnissy-core-c04a283a7ab97903683f5f7268068aef69f5bddf.tar.gz
nissy-core-c04a283a7ab97903683f5f7268068aef69f5bddf.zip
Added benchmark; removed old folder
Diffstat (limited to '')
-rwxr-xr-xbenchmark/benchmark.sh27
1 files changed, 27 insertions, 0 deletions
diff --git a/benchmark/benchmark.sh b/benchmark/benchmark.sh
new file mode 100755
index 0000000..6de280c
--- /dev/null
+++ b/benchmark/benchmark.sh
@@ -0,0 +1,27 @@
1#!/bin/sh
2
3re="${RUN:-$@}"
4
5CC="cc -std=c99 -pedantic -Wall -Wextra \
6 -Wno-unused-parameter -Wno-unused-function -O3 -D$CUBETYPE \
7 -D_POSIX_C_SOURCE=199309L"
8
9[ "$CUBETYPE" = "CUBE_AVX2" ] && CC="$CC -mavx2"
10
11BIN="benchmark/run"
12RES="benchmark/results"
13CUBEOBJ="cube.o"
14d="$(date +'%Y-%m-%d-%H-%M-%S')"
15
16mkdir -p "$RES"
17
18for t in benchmark/*; do
19 if [ -n "$re" ] && [ -z "$(echo "$t" | grep "$re")" ]; then
20 continue
21 fi
22 if [ ! -d "$t" ] || [ "$t" = "benchmark/results" ]; then continue; fi
23 $CC -o $BIN $t/*.c $CUBEOBJ || exit 1;
24 $BIN | tee "$RES/results-$d.txt" "$RES/results-last.txt"
25done
26
27rm -rf $BIN $CUBEOBJ

Generated with cgit - Back to sebastiano.tronto.net