Skip to content

Commit a4543e4

Browse files
authored
Handle OPENBLAS_LOOP
1 parent 2376aa1 commit a4543e4

1 file changed

Lines changed: 13 additions & 5 deletions

File tree

benchmark/syrk.c

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -56,17 +56,20 @@ int main(int argc, char *argv[]){
5656

5757
char uplo='U';
5858
char trans='N';
59-
59+
6060
if ((p = getenv("OPENBLAS_UPLO"))) uplo=*p;
6161
if ((p = getenv("OPENBLAS_TRANS"))) trans=*p;
6262

63-
blasint m, i, j;
63+
blasint m, i, j, l;
6464

6565
int from = 1;
6666
int to = 200;
6767
int step = 1;
68+
int loops = 1;
69+
70+
if ((p = getenv("OPENBLAS_LOOPS"))) loops=*p;
6871

69-
double time1;
72+
double time1,timeg;
7073

7174
argc--;argv++;
7275

@@ -95,9 +98,12 @@ int main(int argc, char *argv[]){
9598

9699
for(m = from; m <= to; m += step)
97100
{
101+
timeg = 0.;
98102

99103
fprintf(stderr, " %6d : ", (int)m);
100104

105+
for(l = 0; l < loops; l++) {
106+
101107
for(j = 0; j < m; j++){
102108
for(i = 0; i < m * COMPSIZE; i++){
103109
a[(long)i + (long)j * (long)m * COMPSIZE] = ((FLOAT) rand() / (FLOAT) RAND_MAX) - 0.5;
@@ -111,8 +117,10 @@ int main(int argc, char *argv[]){
111117

112118
end();
113119

114-
time1 = getsec();
115-
120+
timeg += getsec();
121+
122+
} //loops
123+
time1 = timeg / (double)loops;
116124
fprintf(stderr,
117125
" %10.2f MFlops\n",
118126
COMPSIZE * COMPSIZE * 1. * (double)m * (double)m * (double)m / time1 * 1.e-6);

0 commit comments

Comments
 (0)