home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Usenet 1994 October
/
usenetsourcesnewsgroupsinfomagicoctober1994disk2.iso
/
misc
/
volume21
/
cloops
/
part01
/
tick.c
< prev
next >
Wrap
C/C++ Source or Header
|
1991-07-25
|
2KB
|
102 lines
/*
* This file is part of the Livermore Loops transliteration into C.
* Copyright (C) 1991 by Martin Fouts
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 1, or (at your option)
* any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#include <stdio.h>
#include "types.h"
#include "externs.h"
#define TEST(x) if ((DoTest & (1<<(x-1))) == (1<<(x-1)))
extern long int DoTest;
Void test();
Void valid();
Void stats();
Float tick(logio, iter)
Int logio, iter;
{
Int k, neff;
Float tsec[16], stat[12], tickvalue;
Int map[47];
ion= logio;
kr = iter;
n = 0;
lp = 0;
k2 = 0;
k3 = 0;
j5 = 23456;
m = 0;
test((Int)0);
test((Int)1);
test((Int)2);
test((Int)3);
test((Int)4);
test((Int)5);
test((Int)6);
test((Int)7);
test((Int)8);
test((Int)9);
test((Int)10);
test((Int)11);
test((Int)12);
test((Int)13);
test((Int)14);
test((Int)15);
test((Int)16);
j5 = 0;
for (k = 0; k < 15; k++) {
tsec[k] = Time[k];
}
valid( Time,map,&neff, (Float)1.0e-6, tsec, (Float)1.0e+4, (Int)15);
stats( stat, Time, neff);
tickvalue = stat[0];
for (k = 0; k < 47; k++) {
Time[k] = 0.0;
csum[k] = 0.0;
}
if (logio < 0) return(tickvalue);
#ifdef STATS
fprintf(stdout," clock overhead:\n");
fprintf(stdout," Average Standev ");
fprintf(stdout,"Minimum Maximum\n");
fprintf(stdout," tick ");
for (k = 0; k < 4; k++)
fprintf(stdout,"%15.6f", stat[k]);
fprintf(stdout,"\n");
stats( stat,u,nt1);
fprintf(stdout," data ");
for (k = 0; k < 4; k++)
fprintf(stdout,"%15.6f", stat[k]);
fprintf(stdout,"\n");
stats( stat,&p[0][0],nt2);
fprintf(stdout," data ");
for (k = 0; k < 4; k++)
fprintf(stdout,"%15.6f", stat[k]);
fprintf(stdout,"\n");
#endif
return(tickvalue);
}