PAPI 7.1.0.0
Loading...
Searching...
No Matches
eventname.c
Go to the documentation of this file.
1#include <stdio.h>
2#include <stdlib.h>
3
4#include "papi.h"
5#include "papi_test.h"
6
7int
8main( int argc, char **argv )
9{
10 int retval;
11 int preset;
12
13 tests_quiet( argc, argv ); /* Set TESTS_QUIET variable */
14
15 if ( ( retval =
17 test_fail( __FILE__, __LINE__, "PAPI_library_init", retval );
18
19 retval = PAPI_event_name_to_code( "PAPI_FP_INS", &preset );
20 if ( retval != PAPI_OK )
21 test_fail( __FILE__, __LINE__, "PAPI_event_name_to_code", retval );
22 if ( preset != PAPI_FP_INS )
23 test_fail( __FILE__, __LINE__, "Wrong preset returned", retval );
24
25 retval = PAPI_event_name_to_code( "PAPI_TOT_CYC", &preset );
26 if ( retval != PAPI_OK )
27 test_fail( __FILE__, __LINE__, "PAPI_event_name_to_code", retval );
28 if ( preset != PAPI_TOT_CYC )
29 test_fail( __FILE__, __LINE__,
30 "*preset returned did not equal PAPI_TOT_CYC", retval );
31
32 test_pass( __FILE__ );
33
34 return 0;
35
36}
Convert a name to a numeric hardware event code.
initialize the PAPI library.
#define PAPI_VER_CURRENT
Definition: f90papi.h:54
#define PAPI_OK
Definition: f90papi.h:73
#define PAPI_TOT_CYC
Definition: f90papi.h:308
#define PAPI_FP_INS
Definition: f90papi.h:366
Return codes and api definitions.
int tests_quiet(int argc, char **argv)
Definition: test_utils.c:376
void PAPI_NORETURN test_fail(const char *file, int line, const char *call, int retval)
Definition: test_utils.c:491
void PAPI_NORETURN test_pass(const char *filename)
Definition: test_utils.c:432
static int preset
int main()
Definition: pernode.c:20
int retval
Definition: zero_fork.c:53