PAPI 7.1.0.0
Loading...
Searching...
No Matches
PAPI_flips.c File Reference
Include dependency graph for PAPI_flips.c:

Go to the source code of this file.

Functions

int your_slow_code ()
 
int main ()
 

Function Documentation

◆ main()

int main ( )

Definition at line 25 of file PAPI_flips.c.

26{
27 float real_time, proc_time,mflips;
28 long long flpins;
29 float ireal_time, iproc_time, imflips;
30 long long iflpins;
31 int retval;
32
33 /***********************************************************************
34 * if PAPI_FP_INS is a derived event in your platform, then your *
35 * platform must have at least three counters to support PAPI_flips, *
36 * because PAPI needs one counter to cycles. So in UltraSparcIII, even *
37 * the platform supports PAPI_FP_INS, but UltraSparcIII only have two *
38 * available hardware counters and PAPI_FP_INS is a derived event in *
39 * this platform, so PAPI_flops returns an error. *
40 ***********************************************************************/
41
42 if((retval=PAPI_flips_rate(PAPI_FP_INS,&ireal_time,&iproc_time,&iflpins,&imflips)) < PAPI_OK)
43 {
44 printf("Could not initialise PAPI_flips \n");
45 printf("Your platform may not support floating point instruction event.\n"); printf("retval: %d\n", retval);
46 exit(1);
47 }
48
50
51
52 if((retval=PAPI_flips_rate(PAPI_FP_INS,&real_time, &proc_time, &flpins, &mflips))<PAPI_OK)
53 {
54 printf("retval: %d\n", retval);
55 exit(1);
56 }
57
58
59 printf("Real_time: %f Proc_time: %f flpins: %lld MFLIPS: %f\n",
60 real_time, proc_time,flpins,mflips);
61
62 exit(0);
63}
int your_slow_code()
Definition: PAPI_flips.c:65
Simplified call to get Mflips/s (floating point instruction rate), real and processor time.
#define PAPI_OK
Definition: f90papi.h:73
#define PAPI_FP_INS
Definition: f90papi.h:366
int retval
Definition: zero_fork.c:53
Here is the call graph for this function:

◆ your_slow_code()

int your_slow_code ( )

Definition at line 65 of file PAPI_flips.c.

66{
67 int i;
68 double tmp=1.1;
69
70 for(i=1; i<2000; i++)
71 {
72 tmp=(tmp+100)/i;
73 }
74 return 0;
75}
double tmp
int i
Here is the caller graph for this function: