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

Go to the source code of this file.

Macros

#define THRESHOLD   10000
 
#define ERROR_RETURN(retval)   { fprintf(stderr, "Error %d %s:line %d: \n", retval,__FILE__,__LINE__); exit(retval); }
 

Functions

int your_slow_code ()
 
int main ()
 

Macro Definition Documentation

◆ ERROR_RETURN

#define ERROR_RETURN (   retval)    { fprintf(stderr, "Error %d %s:line %d: \n", retval,__FILE__,__LINE__); exit(retval); }

Definition at line 20 of file PAPI_mix_hl_ll.c.

◆ THRESHOLD

#define THRESHOLD   10000

Definition at line 19 of file PAPI_mix_hl_ll.c.

Function Documentation

◆ main()

int main ( )

Definition at line 24 of file PAPI_mix_hl_ll.c.

25{
26 float ipc;
27 int retval;
28 int EventSet = PAPI_NULL;
30
31 if ( (retval = PAPI_hl_region_begin("slow_code")) < PAPI_OK )
33
35
36 if ( (retval = PAPI_hl_region_end("slow_code")) < PAPI_OK )
38
39 if ( (retval = PAPI_hl_stop()) < PAPI_OK )
41
42 /* get IPC using low-level API */
45
50
51 if ( (retval = PAPI_start(EventSet)) < PAPI_OK )
53
55
58
59 ipc = (float) ((float)values[0] / (float) ( values[1]));
60
61 printf("Results from the low-level API:\n");
62 printf("IPC: %f\n", ipc);
63
64 exit(0);
65}
#define ERROR_RETURN(retval)
int your_slow_code()
add PAPI preset or native hardware event to an event set
Create a new empty PAPI EventSet.
Read performance events at the beginning of a region.
Read performance events at the end of a region and store the difference to the corresponding beginnin...
Stop a running high-level event set.
Start counting hardware events in an event set.
Stop counting hardware events in an event set.
#define PAPI_OK
Definition: f90papi.h:73
#define PAPI_NULL
Definition: f90papi.h:78
#define PAPI_TOT_CYC
Definition: f90papi.h:308
#define PAPI_TOT_INS
Definition: f90papi.h:317
static int EventSet
Definition: init_fini.c:8
static long long values[NUM_EVENTS]
Definition: init_fini.c:10
#define long_long
Definition: papi.h:559
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 67 of file PAPI_mix_hl_ll.c.

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