Statistics
| Branch: | Revision:

root / synthbench / euroben-ports / base / C / mod2h / mod2h.c @ 0:839f52ef7657

History | View | Annotate | Download (868 Bytes)

1
#include <stdio.h>
2
#include <stdlib.h>
3

    
4
double cclock( void );
5
int    check( double a[], int nsize );
6
void   prthead( void );
7
double rand64( void );
8
void   ranfil( double a[], int nsize );
9
void   state( char * );
10

    
11
int main()
12
{ 
13
   int      nsize;
14
   int      ok, ops;
15
   double   *a;
16
   double   mops, time;
17
   FILE     *inl;
18
// ------------------------------------------------------------------------
19
   state( "mod2h" );
20
   prthead();
21
   inl = fopen( "mod2h.in", "r" );
22
   while( ( fscanf( inl, "%d\n", &nsize ) != EOF ) ) {
23
      a = malloc( nsize*sizeof( double ) );
24
      time = cclock();
25
      ranfil( a, nsize );
26
      time = cclock() - time;
27
      ok   = check( a, nsize );
28
      ops  = 36*nsize;
29
      mops = 1.0e-6*(double)ops/time;
30
      prtspeed( nsize, time, mops, ok ); 
31
      free( a );
32
   }
33
   printf( "----------------------------------------\n" );
34
}