27 int main(
int argc,
char **argv) {
30 long long high=0,low=0,average=0,
expected=1500000;
40 printf(
"\nTesting the PAPI_BR_INS event.\n");
60 printf(
"Testing a loop with %lld branches (%d times):\n",
64 for(
i=0;
i<num_runs;
i++) {
73 fprintf(stderr,
"\tCode unimplemented\n");
74 test_skip( __FILE__, __LINE__,
"unimplemented", 0);
79 "reading PAPI_TOT_INS",
retval );
87 average=(
total/num_runs);
91 if ((error > 1.0) || (error<-1.0)) {
92 if (!
quiet) printf(
"Instruction count off by more than 1%%\n");
93 test_fail( __FILE__, __LINE__,
"Error too high", 1 );
96 if (!
quiet) printf(
"\n");
int PAPI_stop(int EventSet, long long *values)
void test_pass(const char *filename)
static int expected[NUM_THREADS]
int PAPI_reset(int EventSet)
int main(int argc, char **argv)
double display_error(long long average, long long high, long long low, long long expected, int quiet)
#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)
int PAPI_create_eventset(int *EventSet)
int branches_testcode(void)
int tests_quiet(int argc, char **argv)
void test_fail(const char *file, int line, const char *call, int retval)
int PAPI_start(int EventSet)