PAPI 7.1.0.0
Loading...
Searching...
No Matches
high_level.c File Reference
Include dependency graph for high_level.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

void computation_mult ()
 
void computation_add ()
 
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 high_level.c.

◆ THRESHOLD

#define THRESHOLD   10000

Definition at line 19 of file high_level.c.

Function Documentation

◆ computation_add()

void computation_add ( )

Definition at line 34 of file high_level.c.

35{
36 int tmp = 0;
37 int i=0;
38
39 for( i = 0; i < THRESHOLD; i++ )
40 {
41 tmp = tmp + i;
42 }
43
44}
double tmp
int i
#define THRESHOLD
Definition: high_level.c:19
Here is the caller graph for this function:

◆ computation_mult()

void computation_mult ( )

Definition at line 23 of file high_level.c.

24{
25 double tmp=1.0;
26 int i=1;
27 for( i = 1; i < THRESHOLD; i++ )
28 {
29 tmp = tmp*i;
30 }
31}
Here is the caller graph for this function:

◆ main()

int main ( )

Definition at line 47 of file high_level.c.

48{
49 int retval;
50 char errstring[PAPI_MAX_STR_LEN];
51
52 retval = PAPI_hl_region_begin("computation_add");
53 if ( retval != PAPI_OK )
55
56 /* Your code goes here*/
58
59 retval = PAPI_hl_read("computation_add");
60 if ( retval != PAPI_OK )
62
63 /* Your code goes here*/
65
66 retval = PAPI_hl_region_end("computation_add");
67 if ( retval != PAPI_OK )
69
70
71 retval = PAPI_hl_region_begin("computation_mult");
72 if ( retval != PAPI_OK )
74
75 /* Your code goes here*/
77
78 retval = PAPI_hl_region_end("computation_mult");
79 if ( retval != PAPI_OK )
81
82 exit(0);
83}
Read performance events inside of a region and store the difference to the corresponding beginning of...
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...
#define PAPI_OK
Definition: f90papi.h:73
#define PAPI_MAX_STR_LEN
Definition: f90papi.h:77
void computation_add()
Definition: high_level.c:34
#define ERROR_RETURN(retval)
Definition: high_level.c:20
void computation_mult()
Definition: high_level.c:23
int retval
Definition: zero_fork.c:53
Here is the call graph for this function: