PAPI  5.4.0.0
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
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.

24 {
25  float real_time, proc_time,mflips;
26  long long flpins;
27  float ireal_time, iproc_time, imflips;
28  long long iflpins;
29  int retval;
30 
31  /***********************************************************************
32  * if PAPI_FP_INS is a derived event in your platform, then your *
33  * platform must have at least three counters to support PAPI_flips, *
34  * because PAPI needs one counter to cycles. So in UltraSparcIII, even *
35  * the platform supports PAPI_FP_INS, but UltraSparcIII only have two *
36  * available hardware counters and PAPI_FP_INS is a derived event in *
37  * this platform, so PAPI_flops returns an error. *
38  ***********************************************************************/
39 
40  if((retval=PAPI_flips(&ireal_time,&iproc_time,&iflpins,&imflips)) < PAPI_OK)
41  {
42  printf("Could not initialise PAPI_flips \n");
43  printf("Your platform may not support floating point instruction event.\n"); printf("retval: %d\n", retval);
44  exit(1);
45  }
46 
48 
49 
50  if((retval=PAPI_flips( &real_time, &proc_time, &flpins, &mflips))<PAPI_OK)
51  {
52  printf("retval: %d\n", retval);
53  exit(1);
54  }
55 
56 
57  printf("Real_time: %f Proc_time: %f Total flpins: %lld MFLIPS: %f\n",
58  real_time, proc_time,flpins,mflips);
59 
60  exit(0);
61 }
return PAPI_OK
Definition: linux-nvml.c:458
#define printf
Definition: papi_test.h:125
int your_slow_code()
Definition: PAPI_flips.c:63
int PAPI_flips(float *rtime, float *ptime, long long *flpins, float *mflips)
Definition: papi_hl.c:204
ssize_t retval
Definition: libasync.c:338
void exit()

Here is the call graph for this function:

int your_slow_code ( )

Definition at line 63 of file PAPI_flips.c.

64 {
65  int i;
66  double tmp=1.1;
67 
68  for(i=1; i<2000; i++)
69  {
70  tmp=(tmp+100)/i;
71  }
72  return 0;
73 }
int i
Definition: fileop.c:140
long long tmp
Definition: iozone.c:12031

Here is the caller graph for this function: