25 {
26
30
31 int errors=0;
36 double aSumm = 0.0;
37 double error;
38
40
42 printf("Testing the PAPI_L1_DCA event\n");
43 }
44
45
49 }
50
54 }
55
59 }
60
61
62
63
64
65
66
68 printf("Write Test: Initializing an array of %d doubles:\n",
70 }
71
72 high=0; low=0;
total=0;
73
74 for(
i=0;
i<num_runs;
i++) {
75
78
80
82
85 "reading PAPI_L1_DCA",
retval );
86 }
87
91 }
92
93 average=(
total/num_runs);
94
96
97 if ((error > 1.0) || (error<-1.0)) {
98 if (!
quiet) printf(
"Instruction count off by more than 1%%\n");
99 errors++;
100 }
101
102 if (!
quiet) printf(
"\n");
103
104
105
106
107
108
109
111 printf("Read Test: Summing an array of %d doubles:\n",
113 }
114
115 high=0; low=0;
total=0;
116
117 for(
i=0;
i<num_runs;
i++) {
118
121
122
124
126
129 "reading PAPI_L1_DCA",
retval );
130 }
131
135 }
136
138 printf("\tRead test sim= %lf\n",aSumm);
139 }
140
141 average=(
total/num_runs);
142
144
145 if ((error > 1.0) || (error<-1.0)) {
146 if (!
quiet) printf(
"Instruction count off by more than 1%%\n");
147 errors++;
148 }
149
151 printf("\n");
152 }
153
154 if (errors) {
155 test_fail( __FILE__, __LINE__,
"Error too high", 1 );
156 }
157
159
160 return 0;
161}
int cache_write_test(double *array, int size)
double cache_read_test(double *array, int size)
add PAPI preset or native hardware event by name to an EventSet
Create a new empty PAPI EventSet.
initialize the PAPI library.
Reset the hardware event counts in an event set.
Start counting hardware events in an event set.
Stop counting hardware events in an event set.
static int expected[NUM_THREADS]
double display_error(long long average, long long high, long long low, long long expected, int quiet)
static double array[ARRAYSIZE]
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)