48 long long count,high=0,low=0,
total=0,average=0;
66 printf(
"\nTesting PAPI_TOT_CYC\n\n");
70 printf(
"Testing a sleep of 1 second (%d times):\n",
SLEEP_RUNS);
80 if (!
quiet) printf(
"Could not add PAPI_TOT_CYC\n");
105 printf(
"\tAverage should be low, as no user cycles when sleeping\n");
106 printf(
"\tMeasured average: %lld\n",average);
109 if (average>100000) {
110 if (!
quiet) printf(
"Average cycle count too high!\n");
119 printf(
"\nEstimating GHz with matrix matrix multiply\n");
128 clock_gettime(CLOCK_REALTIME,&before);
141 clock_gettime(CLOCK_REALTIME,&after);
145 mmm_ghz=(double)
count/(
double)nsecs;
148 printf(
"\tActual measured cycles = %lld\n",
count);
149 printf(
"\tEstimated actual GHz = %.2lfGHz\n",mmm_ghz);
158 if (!
quiet) printf(
"\nTesting for a linear cycle increase\n");
160 #define REPITITIONS 2 162 clock_gettime(CLOCK_REALTIME,&before);
177 clock_gettime(CLOCK_REALTIME,&after);
187 printf(
"\tError=%.2f%%\n",error);
190 if ((error>10.0) || (error<-10.0)) {
192 if (!
quiet) printf(
"Error too high!\n");
196 if (!
quiet) printf(
"\n");
int PAPI_stop(int EventSet, long long *values)
static long long convert_to_ns(struct timespec *before, struct timespec *after)
void test_pass(const char *filename)
static int expected[NUM_THREADS]
int PAPI_reset(int EventSet)
double naive_matrix_multiply(int quiet)
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 PAPI_create_eventset(int *EventSet)
int tests_quiet(int argc, char **argv)
void test_fail(const char *file, int line, const char *call, int retval)
int PAPI_start(int EventSet)