90{
99
100
102
106 }
107
111 }
112
113
114
115
117 if (!
quiet) printf(
"No events found!\n");
118 test_skip( __FILE__, __LINE__,
"no PAPI_event", 0 );
119 }
120
125
129
131
134
135
140 }
141
146 }
147
150
152
156
161 printf( "PAPI_get_overflow_event_index error: %s\n",
163 }
164
169 printf( "PAPI_get_overflow_event_index error: %s\n",
171 }
172
175
176
189
192
194
197
202 printf( "PAPI_get_overflow_event_index error: %s\n",
204 }
205
210 printf( "PAPI_get_overflow_event_index error: %s\n",
212 }
213
216
220 }
221
225 }
226
228
230 printf( "Test case: Overflow dispatch of both events in set with 2 events.\n" );
231 printf( "---------------------------------------------------------------\n" );
232 printf(
"Threshold for overflow is: %d\n",
threshold );
233 printf(
"Using %d iterations of c += a*b\n",
NUM_FLOPS );
234 printf( "-----------------------------------------------\n" );
235
236 printf( "Test type : %18s%18s%18s\n", "1 (no overflow)", "2 (batch)",
237 "3 (interleaf)" );
242 printf( "\n" );
243
244 printf(
"Predicted overflows at event %-12s : %6d\n",
event_name[0],
246 printf(
"Predicted overflows at event %-12s : %6d\n",
event_name[1],
248
249 printf( "\nBatch overflows (add, add, over, over):\n" );
250 for ( k = 0; k < 2; k++ ) {
254 }
255 }
256
257 printf( "\nInterleaved overflows (add, over, add, over):\n" );
258 for ( k = 0; k < 2; k++ ) {
264 }
265
266 printf(
"\nCases 2+3 Unknown overflows: %d\n",
total_unknown );
267 printf( "-----------------------------------------------\n" );
268 }
269
271 test_fail( __FILE__, __LINE__,
"a batch counter had no overflows", 1 );
272
275 "an interleaved counter had no overflows", 1 );
276
278 test_fail( __FILE__, __LINE__,
"Unknown counter had overflows", 1 );
279
281
282 return 0;
283}
add PAPI preset or native hardware event to an event set
Empty and destroy an EventSet.
Create a new empty PAPI EventSet.
Convert a numeric hardware event code to a name.
converts an overflow vector into an array of indexes to overflowing events
initialize the PAPI library.
Set up an event set to begin registering overflows.
Start counting hardware events in an event set.
Stop counting hardware events in an event set.
Returns a string describing the PAPI error code.
char event_name[2][PAPI_MAX_STR_LEN]
static long long values[NUM_EVENTS]
static void handler_interleaf(int EventSet, void *address, long long overflow_vector, void *context)
static void handler_batch(int EventSet, void *address, long long overflow_vector, void *context)
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)
int find_nonderived_event(void)
void PAPI_NORETURN test_skip(const char *file, int line, const char *call, int retval)