30 {
31
33
34 double error;
35
37 long long count,high=0,low=0,
total=0,average=0;
38 long long mmm_count;
42
44
45
49 }
50
52 printf("\nTesting PAPI_LD_INS\n\n");
53 }
54
58 }
59
62 if (!
quiet) printf(
"Could not add PAPI_LD_INS\n");
64 }
65
66
67
68
69
70
72 printf(
"Testing a sleep of 1 second (%d times):\n",
SLEEP_RUNS);
73 }
74
76
79
80 sleep(1);
81
85 }
86
90 }
91
93
95 printf("\tAverage should be low, as no loads when sleeping\n");
96 printf("\tMeasured average: %lld\n",average);
97 }
98
99 if (average>100000) {
100 if (!
quiet) printf(
"Average cycle count too high!\n");
102 }
103
104
105
106
107
109 printf("\nTesting with matrix matrix multiply\n");
110 }
111
114
116
118
121 }
122
124
126 printf(
"\tActual measured loads = %lld\n",
count);
127 }
128
130
133 printf("\tError=%.2f%%\n",error);
134 }
135
136 if ((error>10.0) || (error<-10.0)) {
137
138 if (!
quiet) printf(
"Error too high!\n");
140 }
141
142
144
145
146
147
148
149 if (!
quiet) printf(
"\nTesting for a linear cycle increase\n");
150
151#define REPITITIONS 2
152
155
158 }
159
161
164 }
165
167
169
172 printf("\tError=%.2f%%\n",error);
173 }
174
175 if ((error>10.0) || (error<-10.0)) {
176
177 if (!
quiet) printf(
"Error too high!\n");
179 }
180
181 if (!
quiet) printf(
"\n");
182
184
185 return 0;
186}
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]
long long naive_matrix_multiply_estimated_loads(int quiet)
double naive_matrix_multiply(int quiet)
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)