diff options
| author | Sebastiano Tronto <sebastiano@tronto.net> | 2024-06-13 22:28:49 +0200 |
|---|---|---|
| committer | Sebastiano Tronto <sebastiano@tronto.net> | 2024-06-13 22:28:49 +0200 |
| commit | c04a283a7ab97903683f5f7268068aef69f5bddf (patch) | |
| tree | 9809c4a71c2ad1a5123371c32c34f03b1b703ecf /benchmark/benchmark.sh | |
| parent | 7812684339d03f6993882358b0045c1bc2d5032c (diff) | |
| download | nissy-core-c04a283a7ab97903683f5f7268068aef69f5bddf.tar.gz nissy-core-c04a283a7ab97903683f5f7268068aef69f5bddf.zip | |
Added benchmark; removed old folder
Diffstat (limited to '')
| -rwxr-xr-x | benchmark/benchmark.sh | 27 |
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 | |||
| 3 | re="${RUN:-$@}" | ||
| 4 | |||
| 5 | CC="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 | |||
| 11 | BIN="benchmark/run" | ||
| 12 | RES="benchmark/results" | ||
| 13 | CUBEOBJ="cube.o" | ||
| 14 | d="$(date +'%Y-%m-%d-%H-%M-%S')" | ||
| 15 | |||
| 16 | mkdir -p "$RES" | ||
| 17 | |||
| 18 | for 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" | ||
| 25 | done | ||
| 26 | |||
| 27 | rm -rf $BIN $CUBEOBJ | ||
