22 {
23
25 long long high=0,low=0,average=0,
expected=1500000;
26 double error,double_result;
27
31
33
35 printf("\nTesting the PAPI_DP_OPS event.\n\n");
36 }
37
38
42 }
43
44
48 }
49
50
53 if (!
quiet) fprintf(
stderr,
"PAPI_DP_OPS not available!\n");
55 }
56
57
58
59
61
63 printf("Testing a loop with %lld floating point (%d times):\n",
65 }
66
67 for(
i=0;
i<num_runs;
i++) {
70
72
74
76 fprintf(
stderr,
"\tCode unimplemented\n");
77 test_skip( __FILE__, __LINE__,
"unimplemented", 0);
78 }
79
82 "reading PAPI_TOT_INS",
retval );
83 }
84
88 }
89
90 average=(
total/num_runs);
91
93
94 if (average>10) {
95 if (!
quiet) printf(
"Unexpected FP event value\n");
96 test_fail( __FILE__, __LINE__,
"Unexpected FP event", 1 );
97 }
98
99 if (!
quiet) printf(
"\n");
100
101
102
103
104 total=0; high=0; low=0;
106
108
109 num_runs=3;
110
112 printf("Testing a matrix multiply with %lld single-precision FP operations (%d times)\n",
114 }
115
116 for(
i=0;
i<num_runs;
i++) {
117
120
122
124
127 "reading PAPI_TOT_INS",
retval );
128 }
129
133 }
134
135 if (!
quiet) printf(
"Result %lf\n",double_result);
136
137 average=(
total/num_runs);
138
140
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 );
144 }
145
146 if (!
quiet) printf(
"\n");
147
148
149
150
151
152 total=0; high=0; low=0;
154
155 num_runs=3;
156
158 printf("Testing a matrix multiply with %lld double-precision FP operations (%d times)\n",
160 }
161
162 for(
i=0;
i<num_runs;
i++) {
163
166
168
170
173 "reading PAPI_TOT_INS",
retval );
174 }
175
179 }
180
181 if (!
quiet) printf(
"Result %lf\n",double_result);
182
183 average=(
total/num_runs);
184
186
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 );
190 }
191
192 if (!
quiet) printf(
"\n");
193
194
196
198
199 return 0;
200}
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)
double flops_double_matrix_matrix_multiply(void)
int flops_double_init_matrix(void)
float flops_float_matrix_matrix_multiply(void)
int flops_float_init_matrix(void)
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