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

Go to the source code of this file.

Functions

int main (int argc, char **argv)
 

Variables

int TESTS_QUIET
 

Function Documentation

int main ( int  argc,
char **  argv 
)

Definition at line 10 of file high-level2.c.

11 {
12  int retval;
13  int Events, fip = 0;
14  long long values, flpins;
15  float real_time, proc_time, mflops;
16 
17  tests_quiet( argc, argv ); /* Set TESTS_QUIET variable */
19  if ( retval != PAPI_VER_CURRENT )
20  test_fail( __FILE__, __LINE__, "PAPI_library_init", retval );
21 
22  if ( PAPI_query_event( PAPI_FP_INS ) == PAPI_OK ) {
23  fip = 1;
24  Events = PAPI_FP_INS;
25  } else if ( PAPI_query_event( PAPI_FP_OPS ) == PAPI_OK ) {
26  fip = 2;
27  Events = PAPI_FP_OPS;
28  } else {
29  if ( !TESTS_QUIET )
30  printf
31  ( "PAPI_FP_INS and PAPI_FP_OPS are not defined for this platform.\n" );
32  }
33 
34  if ( fip > 0 ) {
35  if ( fip == 1 ) {
36  if ( ( retval =
37  PAPI_flips( &real_time, &proc_time, &flpins,
38  &mflops ) ) != PAPI_OK )
39  test_fail( __FILE__, __LINE__, "PAPI_flips", retval );
40  } else {
41  if ( ( retval =
42  PAPI_flops( &real_time, &proc_time, &flpins,
43  &mflops ) ) != PAPI_OK )
44  test_fail( __FILE__, __LINE__, "PAPI_flops", retval );
45  }
46  if ( ( retval = PAPI_start_counters( &Events, 1 ) ) == PAPI_OK )
47  test_fail( __FILE__, __LINE__, "PAPI_start_counters", retval );
48  if ( fip == 1 ) {
49  if ( ( retval =
50  PAPI_flips( &real_time, &proc_time, &flpins,
51  &mflops ) ) != PAPI_OK )
52  test_fail( __FILE__, __LINE__, "PAPI_flips", retval );
53  } else {
54  if ( ( retval =
55  PAPI_flops( &real_time, &proc_time, &flpins,
56  &mflops ) ) != PAPI_OK )
57  test_fail( __FILE__, __LINE__, "PAPI_flops", retval );
58  }
59  if ( ( retval = PAPI_read_counters( &values, 1 ) ) == PAPI_OK )
60  test_fail( __FILE__, __LINE__, "PAPI_read_counters", retval );
61  if ( ( retval = PAPI_stop_counters( &values, 1 ) ) != PAPI_OK )
62  test_fail( __FILE__, __LINE__, "PAPI_stop_counters", retval );
63  if ( fip == 1 ) {
64  if ( ( retval =
65  PAPI_flips( &real_time, &proc_time, &flpins,
66  &mflops ) ) != PAPI_OK )
67  test_fail( __FILE__, __LINE__, "PAPI_flips", retval );
68  } else {
69  if ( ( retval =
70  PAPI_flops( &real_time, &proc_time, &flpins,
71  &mflops ) ) != PAPI_OK )
72  test_fail( __FILE__, __LINE__, "PAPI_flops", retval );
73  }
74  if ( ( retval = PAPI_read_counters( &values, 1 ) ) == PAPI_OK )
75  test_fail( __FILE__, __LINE__, "PAPI_read_counters", retval );
76  if ( ( retval = PAPI_stop_counters( &values, 1 ) ) != PAPI_OK )
77  test_fail( __FILE__, __LINE__, "PAPI_stop_counters", retval );
78  if ( ( retval = PAPI_start_counters( &Events, 1 ) ) != PAPI_OK )
79  test_fail( __FILE__, __LINE__, "PAPI_start_counters", retval );
80  if ( ( retval = PAPI_read_counters( &values, 1 ) ) != PAPI_OK )
81  test_fail( __FILE__, __LINE__, "PAPI_read_counters", retval );
82  if ( fip == 1 ) {
83  if ( ( retval =
84  PAPI_flips( &real_time, &proc_time, &flpins,
85  &mflops ) ) == PAPI_OK )
86  test_fail( __FILE__, __LINE__, "PAPI_flips", retval );
87  } else {
88  if ( ( retval =
89  PAPI_flops( &real_time, &proc_time, &flpins,
90  &mflops ) ) == PAPI_OK )
91  test_fail( __FILE__, __LINE__, "PAPI_flops", retval );
92  }
93  if ( ( retval = PAPI_stop_counters( &values, 1 ) ) != PAPI_OK )
94  test_fail( __FILE__, __LINE__, "PAPI_stop_counters", retval );
95  }
96  test_pass( __FILE__, NULL, 0 );
97  exit( 0 ); /* just to make the compiler happy... */
98 }
static int Events[NUM_EVENTS]
Definition: init_fini.c:8
int PAPI_flops(float *rtime, float *ptime, long long *flpops, float *mflops)
Definition: papi_hl.c:259
return PAPI_OK
Definition: linux-nvml.c:458
#define PAPI_FP_OPS
Definition: fpapi.h:237
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
int PAPI_flips(float *rtime, float *ptime, long long *flpins, float *mflips)
Definition: papi_hl.c:204
test_fail(__FILE__, __LINE__,"PAPI_library_init", retval)
int PAPI_library_init(int version)
Definition: papi.c:495
int PAPI_stop_counters(long long *values, int array_len)
Definition: papi_hl.c:803
#define PAPI_VER_CURRENT
Definition: fpapi.h:14
#define PAPI_FP_INS
Definition: fpapi.h:187
int PAPI_query_event(int EventCode)
Definition: papi.c:696
int PAPI_read_counters(long long *values, int array_len)
Definition: papi_hl.c:706
int PAPI_start_counters(int *events, int array_len)
Definition: papi_hl.c:593
static long long values[NUM_EVENTS]
Definition: init_fini.c:10
ssize_t retval
Definition: libasync.c:338
void exit()

Here is the call graph for this function:

Variable Documentation

int TESTS_QUIET

Definition at line 11 of file test_utils.c.