25 long long high=0,low=0,average=0,
expected=1500000;
26 double error,double_result;
35 printf(
"\nTesting the PAPI_FP_OPS event.\n\n");
53 if (!
quiet) fprintf(stderr,
"PAPI_FP_OPS not available!\n");
60 total=0; high=0; low=0;
64 printf(
"Testing a loop with %lld floating point (%d times):\n",
68 for(
i=0;
i<num_runs;
i++) {
77 fprintf(stderr,
"\tCode unimplemented\n");
78 test_skip( __FILE__, __LINE__,
"unimplemented", 0);
83 "reading PAPI_TOT_INS",
retval );
91 average=(
total/num_runs);
96 if (!
quiet) printf(
"Unexpected FP event value\n");
97 test_fail( __FILE__, __LINE__,
"Unexpected FP event", 1 );
100 if (!
quiet) printf(
"\n");
105 total=0; high=0; low=0;
111 printf(
"Testing a matrix multiply with %lld single-precision FP operations (%d times)\n",
115 for(
i=0;
i<num_runs;
i++) {
126 "reading PAPI_TOT_INS",
retval );
134 if (!
quiet) printf(
"Result %lf\n",double_result);
136 average=(
total/num_runs);
140 if ((error > 1.0) || (error<-1.0)) {
141 if (!
quiet) printf(
"Instruction count off by more than 1%%\n");
142 test_fail( __FILE__, __LINE__,
"Error too high", 1 );
145 if (!
quiet) printf(
"\n");
151 total=0; high=0; low=0;
157 printf(
"Testing a matrix multiply with %lld double-precision FP operations (%d times)\n",
161 for(
i=0;
i<num_runs;
i++) {
172 "reading PAPI_TOT_INS",
retval );
180 if (!
quiet) printf(
"Result %lf\n",double_result);
182 average=(
total/num_runs);
186 if ((error > 1.0) || (error<-1.0)) {
187 if (!
quiet) printf(
"Instruction count off by more than 1%%\n");
188 test_fail( __FILE__, __LINE__,
"Error too high", 1 );
191 if (!
quiet) printf(
"\n");
int PAPI_stop(int EventSet, long long *values)
double flops_double_matrix_matrix_multiply(void)
void test_pass(const char *filename)
static int expected[NUM_THREADS]
int PAPI_reset(int EventSet)
double display_error(long long average, long long high, long long low, long long expected, int quiet)
#define CODE_UNIMPLEMENTED
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 flops_float_init_matrix(void)
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)
float flops_float_matrix_matrix_multiply(void)
int flops_double_init_matrix(void)