Skip to content

Instantly share code, notes, and snippets.

@r1walz
Last active March 27, 2020 00:01
Show Gist options
  • Save r1walz/9669407571640b77e9029541e048400b to your computer and use it in GitHub Desktop.
Save r1walz/9669407571640b77e9029541e048400b to your computer and use it in GitHub Desktop.
#!/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