21 #define ARRAYSIZE 65536 25 int main(
int argc,
char **argv) {
42 printf(
"Testing the PAPI_L1_DCA event\n");
68 printf(
"Write Test: Initializing an array of %d doubles:\n",
72 high=0; low=0;
total=0;
74 for(
i=0;
i<num_runs;
i++) {
85 "reading PAPI_L1_DCA",
retval );
93 average=(
total/num_runs);
97 if ((error > 1.0) || (error<-1.0)) {
98 if (!
quiet) printf(
"Instruction count off by more than 1%%\n");
102 if (!
quiet) printf(
"\n");
111 printf(
"Read Test: Summing an array of %d doubles:\n",
115 high=0; low=0;
total=0;
117 for(
i=0;
i<num_runs;
i++) {
129 "reading PAPI_L1_DCA",
retval );
138 printf(
"\tRead test sim= %lf\n",aSumm);
141 average=(
total/num_runs);
145 if ((error > 1.0) || (error<-1.0)) {
146 if (!
quiet) printf(
"Instruction count off by more than 1%%\n");
155 test_fail( __FILE__, __LINE__,
"Error too high", 1 );
int PAPI_stop(int EventSet, long long *values)
void test_pass(const char *filename)
static int expected[NUM_THREADS]
int PAPI_reset(int EventSet)
double display_error(long long average, long long high, long long low, long long expected, int quiet)
static double array[ARRAYSIZE]
Return codes and api definitions.
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 cache_write_test(double *array, int size)
int main(int argc, char **argv)
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)
double cache_read_test(double *array, int size)