do_loops.c File Reference

Include dependency graph for do_loops.c:

Go to the source code of this file.

Functions

void do_reads (int n)
void fdo_reads (int *n)
void fdo_reads_ (int *n)
void fdo_reads__ (int *n)
void FDO_READS (int *n)
void _FDO_READS (int *n)
void do_flops (int n)
void fdo_flops (int *n)
void fdo_flops_ (int *n)
void fdo_flops__ (int *n)
void FDO_FLOPS (int *n)
void _FDO_FLOPS (int *n)
void do_misses (int n, int bytes)
void fdo_misses (int *n, int *size)
void fdo_misses_ (int *n, int *size)
void fdo_misses__ (int *n, int *size)
void FDO_MISSES (int *n, int *size)
void _FDO_MISSES (int *n, int *size)
void do_flush (void)
void fdo_flush (void)
void fdo_flush_ (void)
void fdo_flush__ (void)
void FDO_FLUSH (void)
void _FDO_FLUSH (void)
void do_l1misses (int n)
void fdo_l1misses (int *n)
void fdo_l1misses_ (int *n)
void fdo_l1misses__ (int *n)
void FDO_L1MISSES (int *n)
void _FDO_L1MISSES (int *n)
void do_stuff (void)
void do_stuff_ (void)
void do_stuff__ (void)
void DO_STUFF (void)
void _DO_STUFF (void)

Variables

volatile int buf [CACHE_FLUSH_BUFFER_SIZE_INTS]
volatile int buf_dummy = 0
volatile int * flush = NULL
volatile int flush_dummy = 0
volatile double a = 0.5
volatile double b = 2.2

Function Documentation

void _DO_STUFF ( void   ) 

Definition at line 293 of file do_loops.c.

00294 {
00295     do_stuff(  );
00296 }

Here is the call graph for this function:

void _FDO_FLOPS ( int *  n  ) 

Definition at line 107 of file do_loops.c.

00108 {
00109     do_flops( *n );
00110 }

Here is the call graph for this function:

void _FDO_FLUSH ( void   ) 

Definition at line 207 of file do_loops.c.

00208 {
00209     do_flush(  );
00210 }

Here is the call graph for this function:

void _FDO_L1MISSES ( int *  n  ) 

Definition at line 243 of file do_loops.c.

00244 {
00245     do_l1misses( *n );
00246 }

Here is the call graph for this function:

void _FDO_MISSES ( int *  n,
int *  size 
)

Definition at line 159 of file do_loops.c.

00160 {
00161     do_misses( *n, *size );
00162 }

Here is the call graph for this function:

void _FDO_READS ( int *  n  ) 

Definition at line 65 of file do_loops.c.

00066 {
00067     do_reads( *n );
00068 }

Here is the call graph for this function:

void do_flops ( int  n  ) 

Definition at line 71 of file do_loops.c.

00072 {
00073     int i;
00074     double c = 0.11;
00075 
00076     for ( i = 0; i < n; i++ ) {
00077         c += a * b;
00078     }
00079     dummy( ( void * ) &c );
00080 }

Here is the call graph for this function:

void do_flush ( void   ) 

Definition at line 165 of file do_loops.c.

00166 {
00167     register int i;
00168     if ( flush == NULL )
00169         flush = ( int * ) malloc( ( 1024 * 1024 * 16 ) * sizeof ( int ) );
00170     if ( !flush )
00171         return;
00172 
00173     dummy( ( void * ) flush );
00174     for ( i = 0; i < ( 1024 * 1024 * 16 ); i++ ) {
00175         flush[i] += flush_dummy;
00176     }
00177     flush_dummy++;
00178     dummy( ( void * ) flush );
00179     dummy( ( void * ) &flush_dummy );
00180 }

Here is the call graph for this function:

Here is the caller graph for this function:

void do_l1misses ( int  n  ) 

Definition at line 213 of file do_loops.c.

00214 {
00215     do_misses( n, L1_MISS_BUFFER_SIZE_INTS );
00216 }

Here is the call graph for this function:

Here is the caller graph for this function:

void do_misses ( int  n,
int  bytes 
)

Definition at line 113 of file do_loops.c.

00114 {
00115     register int i, j, tmp = buf_dummy, len = bytes / ( int ) sizeof ( int );
00116     dummy( ( void * ) buf );
00117     dummy( ( void * ) &buf_dummy );
00118     assert( len <= CACHE_FLUSH_BUFFER_SIZE_INTS );
00119     for ( j = 0; j < n; j++ ) {
00120         for ( i = 0; i < len; i++ ) {
00121             /* We need to read, modify, write here to look
00122                out for the write allocate policies. */
00123             buf[i] += tmp;
00124             /* Fake out some naive prefetchers */
00125             buf[len - 1 - i] -= tmp;
00126         }
00127         tmp += len;
00128     }
00129     buf_dummy = tmp;
00130     dummy( ( void * ) buf );
00131     dummy( ( void * ) &buf_dummy );
00132 }

Here is the call graph for this function:

Here is the caller graph for this function:

void do_reads ( int  n  ) 

Definition at line 12 of file do_loops.c.

00013 {
00014     int i, retval;
00015     static int fd = -1;
00016     char buf;
00017 
00018     if ( fd == -1 ) {
00019         fd = open( "/dev/zero", O_RDONLY );
00020         if ( fd == -1 ) {
00021             perror( "open(/dev/zero)" );
00022             exit( 1 );
00023         }
00024     }
00025 
00026     for ( i = 0; i < n; i++ ) {
00027         retval = ( int ) read( fd, &buf, sizeof ( buf ) );
00028         if ( retval != sizeof ( buf ) ) {
00029             if ( retval < 0 )
00030                 perror( "/dev/zero cannot be read" );
00031             else
00032                 fprintf( stderr,
00033                          "/dev/zero cannot be read: only got %d bytes.\n",
00034                          retval );
00035             exit( 1 );
00036         }
00037     }
00038 }

Here is the call graph for this function:

Here is the caller graph for this function:

void DO_STUFF ( void   ) 

Definition at line 287 of file do_loops.c.

00288 {
00289     do_stuff(  );
00290 }

Here is the call graph for this function:

void do_stuff ( void   ) 

Definition at line 249 of file do_loops.c.

00250 {
00251     static int loops = 0;
00252 
00253     if ( loops == 0 ) {
00254         struct timeval now, then;
00255         gettimeofday( &then, NULL );
00256         do {
00257             do_flops( NUM_FLOPS );
00258             do_reads( NUM_READS );
00259             do_misses( 1, 1024 * 1024 );
00260             gettimeofday( &now, NULL );
00261             loops++;
00262         } while ( now.tv_sec - then.tv_sec < NUM_WORK_SECONDS );
00263     } else {
00264         int i = 0;
00265         do {
00266             do_flops( NUM_FLOPS );
00267             do_reads( NUM_READS );
00268             do_misses( 1, 1024 * 1024 );
00269             i++;
00270         } while ( i < loops );
00271     }
00272 }

Here is the call graph for this function:

Here is the caller graph for this function:

void do_stuff_ ( void   ) 

Definition at line 275 of file do_loops.c.

00276 {
00277     do_stuff(  );
00278 }

Here is the call graph for this function:

void do_stuff__ ( void   ) 

Definition at line 281 of file do_loops.c.

00282 {
00283     do_stuff(  );
00284 }

Here is the call graph for this function:

void FDO_FLOPS ( int *  n  ) 

Definition at line 101 of file do_loops.c.

00102 {
00103     do_flops( *n );
00104 }

Here is the call graph for this function:

void fdo_flops ( int *  n  ) 

Definition at line 83 of file do_loops.c.

00084 {
00085     do_flops( *n );
00086 }

Here is the call graph for this function:

Here is the caller graph for this function:

void fdo_flops_ ( int *  n  ) 

Definition at line 89 of file do_loops.c.

00090 {
00091     do_flops( *n );
00092 }

Here is the call graph for this function:

void fdo_flops__ ( int *  n  ) 

Definition at line 95 of file do_loops.c.

00096 {
00097     do_flops( *n );
00098 }

Here is the call graph for this function:

void FDO_FLUSH ( void   ) 

Definition at line 201 of file do_loops.c.

00202 {
00203     do_flush(  );
00204 }

Here is the call graph for this function:

void fdo_flush ( void   ) 

Definition at line 183 of file do_loops.c.

00184 {
00185     do_flush(  );
00186 }

Here is the call graph for this function:

void fdo_flush_ ( void   ) 

Definition at line 189 of file do_loops.c.

00190 {
00191     do_flush(  );
00192 }

Here is the call graph for this function:

void fdo_flush__ ( void   ) 

Definition at line 195 of file do_loops.c.

00196 {
00197     do_flush(  );
00198 }

Here is the call graph for this function:

void FDO_L1MISSES ( int *  n  ) 

Definition at line 237 of file do_loops.c.

00238 {
00239     do_l1misses( *n );
00240 }

Here is the call graph for this function:

void fdo_l1misses ( int *  n  ) 

Definition at line 219 of file do_loops.c.

00220 {
00221     do_l1misses( *n );
00222 }

Here is the call graph for this function:

void fdo_l1misses_ ( int *  n  ) 

Definition at line 225 of file do_loops.c.

00226 {
00227     do_l1misses( *n );
00228 }

Here is the call graph for this function:

void fdo_l1misses__ ( int *  n  ) 

Definition at line 231 of file do_loops.c.

00232 {
00233     do_l1misses( *n );
00234 }

Here is the call graph for this function:

void FDO_MISSES ( int *  n,
int *  size 
)

Definition at line 153 of file do_loops.c.

00154 {
00155     do_misses( *n, *size );
00156 }

Here is the call graph for this function:

void fdo_misses ( int *  n,
int *  size 
)

Definition at line 135 of file do_loops.c.

00136 {
00137     do_misses( *n, *size );
00138 }

Here is the call graph for this function:

void fdo_misses_ ( int *  n,
int *  size 
)

Definition at line 141 of file do_loops.c.

00142 {
00143     do_misses( *n, *size );
00144 }

Here is the call graph for this function:

void fdo_misses__ ( int *  n,
int *  size 
)

Definition at line 147 of file do_loops.c.

00148 {
00149     do_misses( *n, *size );
00150 }

Here is the call graph for this function:

void FDO_READS ( int *  n  ) 

Definition at line 59 of file do_loops.c.

00060 {
00061     do_reads( *n );
00062 }

Here is the call graph for this function:

void fdo_reads ( int *  n  ) 

Definition at line 41 of file do_loops.c.

00042 {
00043     do_reads( *n );
00044 }

Here is the call graph for this function:

void fdo_reads_ ( int *  n  ) 

Definition at line 47 of file do_loops.c.

00048 {
00049     do_reads( *n );
00050 }

Here is the call graph for this function:

void fdo_reads__ ( int *  n  ) 

Definition at line 53 of file do_loops.c.

00054 {
00055     do_reads( *n );
00056 }

Here is the call graph for this function:


Variable Documentation

volatile double a = 0.5

Definition at line 9 of file do_loops.c.

volatile double b = 2.2

Definition at line 9 of file do_loops.c.

volatile int buf[CACHE_FLUSH_BUFFER_SIZE_INTS]

Definition at line 5 of file do_loops.c.

volatile int buf_dummy = 0

Definition at line 6 of file do_loops.c.

volatile int* flush = NULL

Definition at line 7 of file do_loops.c.

volatile int flush_dummy = 0

Definition at line 8 of file do_loops.c.


Generated on 26 Jan 2016 for PAPI by  doxygen 1.6.1