16#define MAX_CYCLE_ERROR 30
23main(
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 );
add PAPI preset or native hardware event by name to an EventSet
Create a new empty PAPI EventSet.
Empty and destroy an EventSet.
Get PAPI library or event set options.
get real time counter value in clock cycles Returns the total real time passed since some arbitrary s...
get real time counter value in microseconds
get virtual time counter value in clock cycles
get virtual time counter values in microseconds
initialize the PAPI library.
removes a named hardware event from a PAPI event set.
Start counting hardware events in an event set.
Stop counting hardware events in an event set.
static long long values[NUM_EVENTS]
int instructions_million(void)
Return codes and api definitions.
int tests_quiet(int argc, char **argv)
char * stringify_all_domains(int domains)
char * stringify_granularity(int granularity)
void PAPI_NORETURN test_fail(const char *file, int line, const char *call, int retval)
void PAPI_NORETURN test_pass(const char *filename)
void test_warn(const char *file, int line, const char *call, int retval)
void PAPI_NORETURN test_skip(const char *file, int line, const char *call, int retval)
#define CODE_UNIMPLEMENTED