26 int 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);
int PAPI_stop(int EventSet, long long *values)
const PAPI_component_info_t * PAPI_get_component_info(int cidx)
void test_pass(const char *filename)
int PAPI_add_event(int EventSet, int EventCode)
int PAPI_num_components(void)
int PAPI_event_name_to_code(const char *in, int *out)
Return codes and api definitions.
void test_skip(const char *file, int line, const char *call, int retval)
int PAPI_library_init(int version)
#define PAPI_VERSION_MAJOR(x)
#define PAPI_VERSION_REVISION(x)
char name[PAPI_MAX_STR_LEN]
#define PAPI_VERSION_MINOR(x)
int PAPI_cleanup_eventset(int EventSet)
int PAPI_create_eventset(int *EventSet)
int tests_quiet(int argc, char **argv)
void test_fail(const char *file, int line, const char *call, int retval)
int main(int argc, char **argv)
int PAPI_destroy_eventset(int *EventSet)
int PAPI_start(int EventSet)