39{
42 int iters = 10000000;
52 "PAPI_BR_NTK",
53 "PAPI_BR_PRC",
54 "PAPI_BR_INS",
55 "PAPI_BR_MSP",
56 };
57
58
60
61
62 if ( argc > 1 ) {
63 if ( !strcmp( argv[1], "TESTS_QUIET" ) ) {
64
65 }
66 }
67
72
73
74
75
76
77
78
79
82 }
83
85 printf( "\nAccuracy check of branch presets.\n" );
86 printf( "Comparing a measurement with separate measurements.\n\n" );
87 }
88
89
93 }
94
95
99 }
100
101#ifdef MPX
105 }
106
110 }
111#endif
112
113 nevents = 0;
114
115
118 continue;
121 nevents++;
122 }
123 }
124
125
126 if ( nevents < 1 ) {
127 test_skip( __FILE__, __LINE__,
"Not enough events left...", 0 );
128 }
129
130
131
132
133
134
135 t2 = (
long long)(10000 * 20) * nevents;
136
138 test_skip( __FILE__, __LINE__,
"This test takes too much time",
140 }
141
142
146
148 iters = iters * (
int ) (
t2 /
t1 );
149 else if (
t1 > 30e6 )
150 test_skip( __FILE__, __LINE__,
"This test takes too much time",
152
154
155
156
157
159 printf( "\nFirst run: Together.\n" );
160 }
161
163
166
168
171
173
175 printf(
"\tOperations= %.1f Mflop",
y * 1e-6 );
176 printf(
"\t(%g Mflop/s)\n\n", (
y / (
double ) (
t2 -
t1 ) ) );
177 printf( "PAPI grouped measurement:\n" );
178
179 for ( j = 0; j < nevents; j++ ) {
183 printf( "\n" );
184 }
185 printf( "\n" );
186 }
187
188
191
194
195
199
200
201 for (
i = 0;
i < nevents;
i++ ) {
202
203
206
209
211
213 printf(
"\nReference measurement %d (of %d):\n",
i + 1, nevents );
214 }
215
217
220
222
225
227
228
230 printf(
"\tOperations= %.1f Mflop",
y * 1e-6 );
231 printf(
"\t(%g Mflop/s)\n\n", (
y / (
double ) (
t2 -
t1 ) ) );
233 printf(
"PAPI results:\n%20s = ", info.
short_descr );
234 printf(
LLDFMT, refvalues[
i] );
235 printf( "\n" );
236 }
237 }
238
240 printf( "\n" );
241 }
242
243
244
246 printf( "\n\nRelative accuracy:\n" );
247 printf( "\tEvent\t\tGroup\t\tIndividual\tSpread\n");
248 }
249
250 for ( j = 0; j < nevents; j++ ) {
251 spread[j] = abs( (
int ) ( refvalues[j] -
values[j] ) );
253 spread[j] /= ( double )
values[j];
255 printf( "\t%02d: ",j);
257 printf(
"\t%10lld",
values[j] );
258 printf( "\t%10lld", refvalues[j] );
259 printf("\t%10.3g\n", spread[j] );
260 }
261
262
264
265
267 }
268 else {
269 errors++;
272 }
273 }
274 }
275 }
277 printf( "\n\n" );
278 }
279
280 if ( errors ) {
281 test_fail( __FILE__, __LINE__,
"Values outside threshold",
i );
282 }
283
285
286 return 0;
287}
static const char * event_names[2]
static struct timeval t1 t2
add PAPI preset or native hardware event to an event set
Empty and destroy an EventSet.
Create a new empty PAPI EventSet.
Empty and destroy an EventSet.
Get the event's name and description info.
get real time counter value in microseconds
initialize the PAPI library.
Initialize multiplex support in the PAPI library.
Query if PAPI event exists.
Remove an array of hardware event codes from a PAPI event set.
Convert a standard event set to a multiplexed event set.
Start counting hardware events in an event set.
Stop counting hardware events in an event set.
double do_flops3(double x, int iters, int quiet)
char events[MAX_EVENTS][BUFSIZ]
static long long values[NUM_EVENTS]
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)
char short_descr[PAPI_MIN_STR_LEN]