Last active
March 27, 2020 00:01
-
-
Save r1walz/9669407571640b77e9029541e048400b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
CC= | |
TMP=0 | |
MAX=0 | |
ARCH=$(uname -m) | |
greater () { | |
return $(awk -v a=$1 -v b=$2 'BEGIN { printf "%d", (a > b ? 1 : 0) }') | |
} | |
gbc () { | |
return $(echo "$1 > $2" | bc -l) | |
} | |
case $ARCH in | |
x86_64) | |
CC=gcc | |
;; | |
aarch64) | |
CC=armclang | |
;; | |
esac | |
echo $CC | |
$CC -fopenmp -D_OPENMP -O3 stream.c -o stream | |
for i in {1..10} | |
do | |
TMP=$(./stream | grep Triad | awk '{ print $2 }') | |
greater $TMP $MAX | |
if test $? -ne 0 | |
then | |
MAX=$TMP | |
fi | |
done | |
echo $MAX |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment