File tree Expand file tree Collapse file tree 1 file changed +10
-4
lines changed Expand file tree Collapse file tree 1 file changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -46,14 +46,17 @@ int main(int argc, char *argv[]){
46
46
47
47
if ((p = getenv ("OPENBLAS_UPLO" ))) uplo = * p ;
48
48
49
- blasint m , i , j ;
49
+ blasint m , i , j , l ;
50
50
blasint inc_x = 1 ;
51
51
blasint inc_y = 1 ;
52
52
int from = 1 ;
53
53
int to = 200 ;
54
54
int step = 1 ;
55
+ int loops = 1 ;
55
56
56
- double time1 ;
57
+ if ((p = getenv ("OPENBLAS_LOOPS" ))) loops = * p ;
58
+
59
+ double time1 ,timeg ;
57
60
58
61
argc -- ;argv ++ ;
59
62
@@ -85,8 +88,9 @@ int main(int argc, char *argv[]){
85
88
86
89
for (m = from ; m <= to ; m += step )
87
90
{
88
-
91
+ timeg = 0. ;
89
92
fprintf (stderr , " %6d : " , (int )m );
93
+ for (l = 0 ; l < loops ; l ++ ) {
90
94
for (i = 0 ; i < m * COMPSIZE * abs (inc_x ); i ++ ){
91
95
x [i ] = ((FLOAT ) rand () / (FLOAT ) RAND_MAX ) - 0.5 ;
92
96
}
@@ -107,8 +111,10 @@ int main(int argc, char *argv[]){
107
111
108
112
end ();
109
113
110
- time1 = getsec ();
114
+ timeg += getsec ();
115
+ } // loops
111
116
117
+ time1 = timeg /(double )loops ;
112
118
fprintf (stderr ,
113
119
" %10.2f MFlops\n" ,
114
120
COMPSIZE * COMPSIZE * 2. * (double )m * (double )m / time1 * 1.e-6 );
You can’t perform that action at this time.
0 commit comments