comparison CbC-examples/conv1/benchmark.sh @ 92:689bf9141c8c

add conv1/benchmark.sh
author Nobuyasu Oshiro <dimolto@cr.ie.u-ryukyu.ac.jp>
date Wed, 04 Jan 2012 02:15:01 +0900
parents
children 0b0b0782e795
comparison
equal deleted inserted replaced
91:0a063106bba9 92:689bf9141c8c
1 #!/usr/bin/env zsh
2
3 time=/usr/bin/time
4 CONV1=./conv1
5 num=10
6
7 count=0
8 amount=0
9
10 echo "$CONV1 $1"
11 while [[ $count -lt $num ]]; do
12 # /usr/bin/time -p ./conv1 1 2>&1 >& - |grep '^user'|tr -s " "|cut -f2 -d" "
13 usertime=$( $time -p $CONV1 1 2>&1 >& - |grep '^user'|tr -s " " |cut -f2 -d" ")
14 echo $usertime
15
16 amount=$(($usertime+$amount))
17 if [[ $usertime -lt $min ]]; then
18 min=$usertime
19 fi
20 if [[ $usertime -gt $max ]]; then
21 max=$usertime
22 fi
23 count=$(($count+1))
24 done
25
26 echo "amount time = $amount"
27 echo "maxtime = $max"
28 echo "mintime = $min"
29
30
31 amount=$(($amount - $max - $min))
32 echo "amount time - mintime - maxtime = $amount"
33 #count=$(($count-2))
34 echo "count = $count"
35 averagetime=$(($amount/($count)))
36 echo "average time = $averagetime"
37