26int main (
int argc,
char **argv)
34 int numcmp,cid,example_cid=-1;
48 printf(
"Testing simultaneous component use with PAPI %d.%d.%d\n",
57 for( cid=0; cid<numcmp; cid++) {
60 "PAPI_get_component_info failed\n", 0);
63 printf(
"\tComponent %d - %d events - %s\n", cid,
67 if (strstr(cmpinfo->
name,
"example")) {
76 "Example component not found\n", 0);
80 printf(
"\nFound Example Component at id %d\n",example_cid);
89 "PAPI_create_eventset() failed\n",
retval );
95 "EXAMPLE_ZERO not found\n",
retval );
101 "PAPI_add_events failed\n",
retval );
110 "PAPI_create_eventset() failed\n",
retval );
116 "PAPI_TOT_CYC not available\n",
retval );
122 "NO CPU component found\n",
retval );
125 if (!
quiet) printf(
"\nStarting EXAMPLE_CONSTANT and PAPI_TOT_CYC at the same time\n");
131 "PAPI_start failed\n",
retval );
138 "PAPI_start failed\n",
retval );
156 if (!
quiet) printf(
"Stopping EXAMPLE_CONSTANT and PAPI_TOT_CYC\n\n");
159 if (!
quiet) printf(
"Results from EXAMPLE_CONSTANT: %lld\n",values1[0]);
161 if (values1[0]!=42) {
162 test_fail( __FILE__, __LINE__,
"Result should be 42!\n", 0);
165 if (!
quiet) printf(
"Results from PAPI_TOT_CYC: %lld\n\n",values2[0]);
168 test_fail( __FILE__, __LINE__,
"Result should greater than 0\n", 0);
add PAPI preset or native hardware event to an event set
Empty and destroy an EventSet.
Create a new empty PAPI EventSet.
Empty and destroy an EventSet.
Convert a name to a numeric hardware event code.
get information about a specific software component
initialize the PAPI library.
Get the number of components available on the system.
Start counting hardware events in an event set.
Stop counting hardware events in an event set.
Return codes and api definitions.
#define PAPI_VERSION_REVISION(x)
#define PAPI_VERSION_MAJOR(x)
#define PAPI_VERSION_MINOR(x)
int tests_quiet(int argc, char **argv)
void PAPI_NORETURN test_fail(const char *file, int line, const char *call, int retval)
void PAPI_NORETURN test_pass(const char *filename)
void PAPI_NORETURN test_skip(const char *file, int line, const char *call, int retval)
char name[PAPI_MAX_STR_LEN]