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

Go to the source code of this file.

Functions

int your_slow_code ()
 
int main ()
 

Variables

int i
 
double tmp
 

Function Documentation

◆ main()

int main ( )

Definition at line 23 of file PAPI_get_virt_cyc.c.

24{
25 long long s,s1, e, e1;
26 int retval;
27
28
29 /****************************************************************************
30 * This part initializes the library and compares the version number of the *
31 * header file, to the version of the library, if these don't match then it *
32 * is likely that PAPI won't work correctly.If there is an error, retval *
33 * keeps track of the version number. *
34 ****************************************************************************/
35
37 {
38 printf("Library initialization error! \n");
39 exit(1);
40 }
41
42 /* Here you get initial cycles and time */
43 /* No error checking is done here because this function call is always
44 successful */
45
47
49
50 /*Here you get final cycles and time */
52
54
56
58
59 printf("Virtual cycles : %lld\nVirtual time(ms): %lld\n",e-s,e1-s1);
60
61 /* clean up */
63
64 exit(0);
65}
int your_slow_code()
double s
Definition: byte_profile.c:36
get virtual time counter value in clock cycles
get virtual time counter values in microseconds
initialize the PAPI library.
Finish using PAPI and free all related resources.
#define PAPI_VER_CURRENT
Definition: f90papi.h:54
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 13 of file PAPI_get_virt_cyc.c.

14{
15
16 for(i=1; i<200000; i++)
17 {
18 tmp= (tmp+i)/2;
19 }
20 return 0;
21}
double tmp
int i
Here is the caller graph for this function:

Variable Documentation

◆ i

int i

Definition at line 10 of file PAPI_get_virt_cyc.c.

◆ tmp

double tmp

Definition at line 11 of file PAPI_get_virt_cyc.c.