21#define ARRAYSIZE 65536
25int 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 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)
Return codes and api definitions.
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)