23 int main(
int argc,
char **argv ) {
51 printf(
"Trouble adding PAPI_TOT_CYC: %s\n",
69 if (!
quiet) printf(
"Instructions testcode not available\n");
128 printf(
"Test case 0: start, stop.\n" );
129 printf(
"-----------------------------------------------\n" );
131 printf(
"Default domain is: %d (%s)\n",
tmp,
134 printf(
"Default granularity is: %d (%s)\n",
tmp,
136 printf(
"Using %d iterations 1 million instructions\n",
NUM_LOOPS );
137 printf(
"-------------------------------------------------------------------------\n" );
139 printf(
"Test type : \t 1\n" );
142 printf(
"%-12s %12lld\n",
"PAPI_TOT_CYC : \t",
values[0] );
143 printf(
"%-12s %12lld\n",
"PAPI_TOT_INS : \t",
values[1] );
144 printf(
"%-12s %12.2lf\n",
"IPC : \t", ipc );
146 printf(
"%-12s %12lld\n",
"Real usec : \t",
elapsed_us );
147 printf(
"%-12s %12lld\n",
"Real cycles : \t",
elapsed_cyc );
148 printf(
"%-12s %12lld\n",
"Virt usec : \t", elapsed_virt_us );
149 printf(
"%-12s %12lld\n",
"Virt cycles : \t", elapsed_virt_cyc );
151 printf(
"-------------------------------------------------------------------------\n" );
154 printf(
"Verification: PAPI_TOT_INS should be roughly %d\n",
NUM_LOOPS*1000000 );
160 printf(
"%s Error of %.2f%%\n",
"PAPI_TOT_INS", (100.0 * (
double)(
values[1] - (1000000*
NUM_LOOPS)))/(1000000*
NUM_LOOPS));
161 test_fail( __FILE__, __LINE__,
"Instruction validation", 0 );
166 printf(
"Cycles is zero\n");
167 test_fail( __FILE__, __LINE__,
"Cycles validation", 0 );
171 if ((ipc <=0.01 ) || (ipc >=100.0)) {
172 printf(
"Unlikely IPC of %.2f%%\n", ipc);
173 test_fail( __FILE__, __LINE__,
"IPC validation", 0 );
int PAPI_stop(int EventSet, long long *values)
void test_pass(const char *filename)
long long PAPI_get_virt_usec(void)
char * stringify_granularity(int granularity)
long long PAPI_get_virt_cyc(void)
int main(int argc, char **argv)
#define CODE_UNIMPLEMENTED
Return codes and api definitions.
void test_skip(const char *file, int line, const char *call, int retval)
int PAPI_add_named_event(int EventSet, const char *EventName)
int PAPI_library_init(int version)
char * stringify_all_domains(int domains)
int PAPI_get_opt(int option, PAPI_option_t *ptr)
int instructions_million(void)
int PAPI_create_eventset(int *EventSet)
long long PAPI_get_real_usec(void)
char * PAPI_strerror(int errorCode)
int tests_quiet(int argc, char **argv)
void test_fail(const char *file, int line, const char *call, int retval)
int PAPI_destroy_eventset(int *EventSet)
int PAPI_remove_named_event(int EventSet, const char *EventName)
long long PAPI_get_real_cyc(void)
int PAPI_start(int EventSet)
static long long values[NUM_EVENTS]