PAPI  5.3.2.0
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
clockres.c File Reference
Include dependency graph for clockres.c:

Go to the source code of this file.

Functions

void clockcore (void)
 
int main (int argc, char **argv)
 

Variables

int TESTS_QUIET
 

Function Documentation

void clockcore ( void  )

Definition at line 99 of file clockcore.c.

100 {
101  /* check PAPI_get_real_cyc */
102  clock_res_check( 0 );
103  /* check PAPI_get_real_usec */
104  clock_res_check( 1 );
105 
106  /* check PAPI_get_virt_cyc */
107  /* Virtual */
108  if ( PAPI_get_virt_cyc( ) != -1 ) {
109  clock_res_check( 2 );
110  } else
111  test_fail( __FILE__, __LINE__, "PAPI_get_virt_cyc", -1 );
112 
113  /* check PAPI_get_virt_usec */
114  if ( PAPI_get_virt_usec( ) != -1 ) {
115  clock_res_check( 3 );
116  } else
117  test_fail( __FILE__, __LINE__, "PAPI_get_virt_usec", -1 );
118 }
long long PAPI_get_virt_usec(void)
Definition: papi.c:6246
long long PAPI_get_virt_cyc(void)
Definition: papi.c:6174
test_fail(__FILE__, __LINE__,"PAPI_library_init", retval)
void clock_res_check(int flag)
Definition: clockcore.c:12

Here is the call graph for this function:

Here is the caller graph for this function:

int main ( int  argc,
char **  argv 
)

Definition at line 28 of file clockres.c.

29 {
30  int retval;
31 
32  tests_quiet( argc, argv ); /* Set TESTS_QUIET variable */
33 
34  if ( ( retval =
36  test_fail( __FILE__, __LINE__, "PAPI_library_init", retval );
37 
38  if ( ( retval = PAPI_set_debug( PAPI_VERB_ECONT ) ) != PAPI_OK )
39  test_fail( __FILE__, __LINE__, "PAPI_set_debug", retval );
40 
41  if ( !TESTS_QUIET ) {
42  printf( "Test case: Clock latency and resolution.\n" );
43  printf( "-----------------------------------------------\n" );
44  }
45 
46  clockcore( );
47 
48  test_pass( __FILE__, NULL, 0 );
49  exit( 1 );
50 }
#define PAPI_VERB_ECONT
Definition: fpapi.h:39
return PAPI_OK
Definition: linux-nvml.c:458
tests_quiet(argc, argv)
#define printf
Definition: papi_test.h:125
test_pass(__FILE__, NULL, 0)
int int argc
Definition: iozone.c:1609
int TESTS_QUIET
Definition: test_utils.c:11
char ** argv
Definition: iozone.c:1610
test_fail(__FILE__, __LINE__,"PAPI_library_init", retval)
int PAPI_library_init(int version)
Definition: papi.c:495
#define PAPI_VER_CURRENT
Definition: fpapi.h:14
void clockcore(void)
Definition: clockcore.c:99
ssize_t retval
Definition: libasync.c:338
void exit()
int PAPI_set_debug(int level)
Definition: papi.c:3037

Here is the call graph for this function:

Variable Documentation

int TESTS_QUIET

Definition at line 11 of file test_utils.c.