16 #define MAX_CYCLE_ERROR 30 23 main(
int argc,
char **argv )
50 if (!
quiet) printf(
"Trouble adding PAPI_TOT_CYC\n");
66 if (!
quiet) printf(
"Instructions testcode not available\n");
117 printf(
"Test case 0: start, stop.\n" );
118 printf(
"-----------------------------------------------\n" );
120 printf(
"Default domain is: %d (%s)\n",
tmp,
123 printf(
"Default granularity is: %d (%s)\n",
tmp,
125 printf(
"Using %d iterations 1 million instructions\n",
NUM_LOOPS );
126 printf(
"-------------------------------------------------------------------------\n" );
128 printf(
"Test type : \t 1\n" );
131 printf(
"%-12s %12lld\n",
"PAPI_TOT_CYC : \t",
values[0] );
132 printf(
"%-12s %12lld\n",
"PAPI_TOT_INS : \t",
values[1] );
134 printf(
"%-12s %12lld\n",
"Real usec : \t",
elapsed_us );
135 printf(
"%-12s %12lld\n",
"Real cycles : \t",
elapsed_cyc );
136 printf(
"%-12s %12lld\n",
"Virt usec : \t", elapsed_virt_us );
137 printf(
"%-12s %12lld\n",
"Virt cycles : \t", elapsed_virt_cyc );
139 printf(
"-------------------------------------------------------------------------\n" );
141 printf(
"Verification: PAPI_TOT_CYC should be roughly real_cycles\n" );
142 printf(
"NOTE: Not true if dynamic frequency scaling or turbo boost is enabled.\n" );
143 printf(
"Verification: PAPI_TOT_INS should be roughly %d\n",
NUM_LOOPS*1000000 );
149 if (!
quiet) printf(
"PAPI_TOT_CYC Error of %.2f%%\n",cycles_error);
150 test_warn( __FILE__, __LINE__,
"Cycles validation", 0 );
155 printf(
"%s Error of %.2f%%\n",
"PAPI_TOT_INS", (100.0 * (
double)(
values[1] - (1000000*
NUM_LOOPS)))/(1000000*
NUM_LOOPS));
156 test_fail( __FILE__, __LINE__,
"Instruction 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)
#define CODE_UNIMPLEMENTED
void test_warn(const char *file, int line, const char *call, int retval)
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)
int main(int argc, char **argv)
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)
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]