PAPI_flips.c File Reference

Include dependency graph for PAPI_flips.c:

Go to the source code of this file.

Functions

 main ()
int your_slow_code ()

Function Documentation

main (  ) 

Definition at line 23 of file PAPI_flips.c.

00024 { 
00025   float real_time, proc_time,mflips;
00026   long long flpins;
00027   float ireal_time, iproc_time, imflips;
00028   long long iflpins;
00029   int retval;
00030 
00031   /***********************************************************************
00032    * if PAPI_FP_INS is a derived event in your platform, then your       * 
00033    * platform must have at least three counters to support PAPI_flips,   *
00034    * because PAPI needs one counter to cycles. So in UltraSparcIII, even *
00035    * the platform supports PAPI_FP_INS, but UltraSparcIII only have two  *
00036    * available hardware counters and PAPI_FP_INS is a derived event in   *
00037    * this platform, so PAPI_flops returns an error.                      *
00038    ***********************************************************************/
00039 
00040   if((retval=PAPI_flips(&ireal_time,&iproc_time,&iflpins,&imflips)) < PAPI_OK)
00041   { 
00042     printf("Could not initialise PAPI_flips \n");
00043     printf("Your platform may not support floating point instruction event.\n");    printf("retval: %d\n", retval);
00044     exit(1);
00045   }
00046 
00047   your_slow_code();
00048 
00049   
00050   if((retval=PAPI_flips( &real_time, &proc_time, &flpins, &mflips))<PAPI_OK)
00051   {    
00052     printf("retval: %d\n", retval);
00053     exit(1);
00054   }
00055 
00056 
00057   printf("Real_time: %f Proc_time: %f Total flpins: %lld MFLIPS: %f\n", 
00058          real_time, proc_time,flpins,mflips);
00059 
00060   exit(0);
00061 }

Here is the call graph for this function:

int your_slow_code (  ) 

Definition at line 63 of file PAPI_flips.c.

00064 {
00065   int i;
00066   double  tmp=1.1;
00067 
00068   for(i=1; i<2000; i++)
00069   { 
00070     tmp=(tmp+100)/i;
00071   }
00072   return 0;
00073 }

Here is the caller graph for this function:


Generated on 8 Sep 2016 for PAPI by  doxygen 1.6.1