34{
40
41
43
47 }
48
49
53 } else {
56 }
57
61 }
62
65 if (!
quiet) printf(
"Trouble adding events\n");
67 }
68
70 printf( "\n Incorrect usage of read and accum.\n" );
71 printf( " Some cycles are counted twice\n" );
72 }
75
76
78
81
84
85
87
88
89
92
95
96
98
101
104
107 "(Reading stopped counters)\n" );
108
110
111 printf( "\n Incorrect usage of read and accum.\n" );
112 printf( " Another incorrect use\n" );
113 }
116
117
119
122
125
126
127
129
132
135 "(Intermediate counts...)\n" );
136
137
139
140
141
142
147
150
152 printf( "\n Correct usage of read and accum.\n" );
153 printf( " PAPI_reset and PAPI_accum used to skip counting\n" );
154 printf( " a section of the code.\n" );
155 }
158
160
165
166
168
171
173 printf( "%12s %12s (Counters reset)\n", "", "" );
174
176
179
182
184 printf( "----------------------------------\n" );
185 printf( "Verification: The last line in each experiment should be\n" );
186 printf( "approximately twice the value of the first line.\n" );
187 printf
188 ( "The third case illustrates one possible way to accomplish this.\n" );
189 }
191
192 return 0;
193}
Accumulate and reset counters in an EventSet.
add multiple PAPI presets or native hardware events to an event set
Create a new empty PAPI EventSet.
initialize the PAPI library.
Query if PAPI event exists.
Read hardware counters from an event set.
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 long long values[NUM_EVENTS]
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)