diff options
| author | Sebastiano Tronto <sebastiano@tronto.net> | 2023-11-10 17:07:42 +0100 |
|---|---|---|
| committer | Sebastiano Tronto <sebastiano@tronto.net> | 2023-11-10 19:55:55 +0100 |
| commit | 067ba55add258ab03db328234168af66c4ad87c3 (patch) | |
| tree | f4861907117c420eed3f9c9aa967bf9f2c6a1f7e /old/benchmark/bench.sh | |
| parent | af1399f223e3857a3d2690337e84430cdbeff16a (diff) | |
| download | nissy-core-067ba55add258ab03db328234168af66c4ad87c3.tar.gz nissy-core-067ba55add258ab03db328234168af66c4ad87c3.zip | |
Towards a definitve API
Diffstat (limited to 'old/benchmark/bench.sh')
| -rwxr-xr-x | old/benchmark/bench.sh | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/old/benchmark/bench.sh b/old/benchmark/bench.sh new file mode 100755 index 0000000..cc31c1e --- /dev/null +++ b/old/benchmark/bench.sh | |||
| @@ -0,0 +1,21 @@ | |||
| 1 | #!/bin/sh | ||
| 2 | |||
| 3 | CC="cc -std=c99 -O3 -D$CUBETYPE" | ||
| 4 | if [ "$CUBETYPE" = "CUBE_AVX2" ]; then | ||
| 5 | CC="$CC -mavx2" | ||
| 6 | fi | ||
| 7 | |||
| 8 | BENCHBIN="benchmark/run" | ||
| 9 | BENCHDIR="benchmark/results" | ||
| 10 | CUBEOBJ="cube.o" | ||
| 11 | |||
| 12 | $CC -D_POSIX_C_SOURCE=199309L -o $BENCHBIN benchmark/bench.c $CUBEOBJ || exit 1 | ||
| 13 | |||
| 14 | d="$(date +'%Y-%m-%d-%H-%M-%S')" | ||
| 15 | mkdir -p "$BENCHDIR" | ||
| 16 | $BENCHBIN | tee "$BENCHDIR/results-$d.txt" "$BENCHDIR/results.txt" | ||
| 17 | |||
| 18 | echo "" | ||
| 19 | echo "Results saved to $BENCHDIR/results.txt" | ||
| 20 | |||
| 21 | rm -rf $BENCHBIN $CUBEOBJ | ||
