diff options
| author | Sebastiano Tronto <sebastiano@tronto.net> | 2024-07-03 15:05:10 +0200 |
|---|---|---|
| committer | Sebastiano Tronto <sebastiano@tronto.net> | 2024-07-03 15:05:10 +0200 |
| commit | 4a16da26dacdb37b9ef8d3d11e10ecb94b0cf396 (patch) | |
| tree | 64723639df2a44c94deb26276c5793101d3b6c41 /tools/run_tool.sh | |
| parent | 3c9efb490ccbe1b0d7768d77fcdcac012c00e8c6 (diff) | |
| download | nissy-core-4a16da26dacdb37b9ef8d3d11e10ecb94b0cf396.tar.gz nissy-core-4a16da26dacdb37b9ef8d3d11e10ecb94b0cf396.zip | |
renamed benchmarks to tools
Diffstat (limited to 'tools/run_tool.sh')
| -rwxr-xr-x | tools/run_tool.sh | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/tools/run_tool.sh b/tools/run_tool.sh new file mode 100755 index 0000000..21b6ce9 --- /dev/null +++ b/tools/run_tool.sh | |||
| @@ -0,0 +1,27 @@ | |||
| 1 | #!/bin/sh | ||
| 2 | |||
| 3 | if [ -z "$TOOL" ]; then | ||
| 4 | echo "No tool selected (TOOL variable must be set)" | ||
| 5 | exit 1 | ||
| 6 | fi | ||
| 7 | |||
| 8 | CC="cc -std=c99 -pedantic -Wall -Wextra \ | ||
| 9 | -Wno-unused-parameter -Wno-unused-function -O3 -D$CUBETYPE \ | ||
| 10 | -D_POSIX_C_SOURCE=199309L" | ||
| 11 | |||
| 12 | [ "$CUBETYPE" = "CUBE_AVX2" ] && CC="$CC -mavx2" | ||
| 13 | |||
| 14 | BIN="tools/run" | ||
| 15 | CUBEOBJ="cube.o" | ||
| 16 | d="$(date +'%Y-%m-%d-%H-%M-%S')" | ||
| 17 | |||
| 18 | for t in tools/*; do | ||
| 19 | if [ ! -d "$t" ] || [ -z "$(echo "$t" | grep "$TOOL")" ]; then | ||
| 20 | continue | ||
| 21 | fi | ||
| 22 | $CC -o $BIN $t/*.c $CUBEOBJ || exit 1; | ||
| 23 | $BIN | ||
| 24 | break | ||
| 25 | done | ||
| 26 | |||
| 27 | rm -rf $BIN $CUBEOBJ | ||
