22 int main(
int argc,
char **argv) {
25 long long high=0,low=0,average=0,
expected=1500000;
26 double error,double_result;
35 printf(
"\nTesting the PAPI_DP_OPS event.\n\n");
53 if (!
quiet) fprintf(stderr,
"PAPI_DP_OPS not available!\n");
63 printf(
"Testing a loop with %lld floating point (%d times):\n",
67 for(
i=0;
i<num_runs;
i++) {
76 fprintf(stderr,
"\tCode unimplemented\n");
77 test_skip( __FILE__, __LINE__,
"unimplemented", 0);
82 "reading PAPI_TOT_INS",
retval );
90 average=(
total/num_runs);
95 if (!
quiet) printf(
"Unexpected FP event value\n");
96 test_fail( __FILE__, __LINE__,
"Unexpected FP event", 1 );
99 if (!
quiet) printf(
"\n");
104 total=0; high=0; low=0;
112 printf(
"Testing a matrix multiply with %lld single-precision FP operations (%d times)\n",
116 for(
i=0;
i<num_runs;
i++) {
127 "reading PAPI_TOT_INS",
retval );
135 if (!
quiet) printf(
"Result %lf\n",double_result);
137 average=(
total/num_runs);
141 if ((error > 1.0) || (error<-1.0)) {
142 if (!
quiet) printf(
"Instruction count off by more than 1%%\n");
143 test_fail( __FILE__, __LINE__,
"Error too high", 1 );
146 if (!
quiet) printf(
"\n");
152 total=0; high=0; low=0;
158 printf(
"Testing a matrix multiply with %lld double-precision FP operations (%d times)\n",
162 for(
i=0;
i<num_runs;
i++) {
173 "reading PAPI_TOT_INS",
retval );
181 if (!
quiet) printf(
"Result %lf\n",double_result);
183 average=(
total/num_runs);
187 if ((error > 1.0) || (error<-1.0)) {
188 if (!
quiet) printf(
"Instruction count off by more than 1%%\n");
189 test_fail( __FILE__, __LINE__,
"Error too high", 1 );
192 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
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 flops_float_init_matrix(void)
int PAPI_create_eventset(int *EventSet)
int branches_testcode(void)
int tests_quiet(int argc, char **argv)
int main(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)