23int 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 );
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.
Returns a string describing the PAPI error code.
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 PAPI_NORETURN test_skip(const char *file, int line, const char *call, int retval)
#define CODE_UNIMPLEMENTED