18int main(
int argc,
char **argv) {
21 long long high=0,low=0,average=0,
expected=1000000;
31 printf(
"\nTesting the PAPI_BR_CN event.\n");
51 printf(
"Testing a loop with %lld conditional branches (%d times):\n",
55 for(
i=0;
i<num_runs;
i++) {
64 fprintf(
stderr,
"\tCode unimplemented\n");
65 test_skip( __FILE__, __LINE__,
"unimplemented", 0);
70 "reading PAPI_TOT_INS",
retval );
78 average=(
total/num_runs);
82 if ((error > 1.0) || (error<-1.0)) {
83 if (!
quiet) printf(
"Instruction count off by more than 1%%\n");
84 test_fail( __FILE__, __LINE__,
"Error too high", 1 );
87 if (!
quiet) printf(
"\n");
int branches_testcode(void)
add PAPI preset or native hardware event by name to an EventSet
Create a new empty PAPI EventSet.
initialize the PAPI library.
Reset the hardware event counts in an event set.
Finish using PAPI and free all related resources.
Start counting hardware events in an event set.
Stop counting hardware events in an event set.
static int expected[NUM_THREADS]
double display_error(long long average, long long high, long long low, long long expected, int quiet)
Return codes and api definitions.
int tests_quiet(int argc, char **argv)
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