34#define MINCOUNTS 100000
35#define MPX_TOLERANCE .20
38main(
int argc,
char **argv )
63 if ( !strcmp( argv[1],
"TESTS_QUIET" ) ) {
85 printf(
"\nAccuracy check of branch presets.\n" );
86 printf(
"Comparing a measurement with separate measurements.\n\n" );
127 test_skip( __FILE__, __LINE__,
"Not enough events left...", 0 );
135 t2 = (
long long)(10000 * 20) * nevents;
138 test_skip( __FILE__, __LINE__,
"This test takes too much time",
148 iters = iters * (
int ) (
t2 /
t1 );
149 else if (
t1 > 30e6 )
150 test_skip( __FILE__, __LINE__,
"This test takes too much time",
159 printf(
"\nFirst run: Together.\n" );
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" );
179 for ( j = 0; j < nevents; j++ ) {
201 for (
i = 0;
i < nevents;
i++ ) {
213 printf(
"\nReference measurement %d (of %d):\n",
i + 1, nevents );
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] );
246 printf(
"\n\nRelative accuracy:\n" );
247 printf(
"\tEvent\t\tGroup\t\tIndividual\tSpread\n");
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] );
281 test_fail( __FILE__, __LINE__,
"Values outside threshold",
i );
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]
Return codes and api definitions.
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]