16main(
int argc,
char **argv )
31 test_fail( __FILE__, __LINE__,
"PAPI_get_hardware_info", 2 );
37 "This test is intended only for Pentium 4.", 1 );
41 "This test is intended only for Pentium 4.", 1 );
67 test_fail( __FILE__, __LINE__,
"PAPI_remove_event: PAPI_LD_INS",
87 test_fail( __FILE__, __LINE__,
"PAPI_remove_event: PAPI_SR_INS",
93 test_fail( __FILE__, __LINE__,
"PAPI_add_event: PAPI_LST_INS",
retval );
108 test_fail( __FILE__, __LINE__,
"PAPI_add_event: PAPI_LD_INS",
retval );
122 test_fail( __FILE__, __LINE__,
"PAPI_remove_event: PAPI_LD_INS",
128 test_fail( __FILE__, __LINE__,
"PAPI_add_event: PAPI_SR_INS",
retval );
142 test_fail( __FILE__, __LINE__,
"PAPI_remove_event: PAPI_SR_INS",
147 test_fail( __FILE__, __LINE__,
"PAPI_remove_event: PAPI_LST_INS",
153 test_fail( __FILE__, __LINE__,
"PAPI_add_event: PAPI_LD_INS",
retval );
157 test_fail( __FILE__, __LINE__,
"PAPI_add_event: PAPI_SR_INS",
retval );
171 test_fail( __FILE__, __LINE__,
"PAPI_remove_event: PAPI_LD_INS",
176 test_fail( __FILE__, __LINE__,
"PAPI_remove_event: PAPI_SR_INS",
182 printf(
"Pentium 4 Load / Store tests.\n" );
184 (
"These PAPI events are counted by setting a tag at the front of the pipeline,\n" );
186 (
"and counting tags at the back of the pipeline. All the tags are the same 'color'\n" );
188 (
"and can't be distinguished from each other. Therefore, PAPI_LD_INS and PAPI_SR_INS\n" );
190 (
"cannot be counted with the other two events, or the answer will always == PAPI_LST_INS.\n" );
192 (
"-------------------------------------------------------------------------------------------\n" );
194 printf(
"Default domain is: %d (%s)\n",
tmp,
197 printf(
"Default granularity is: %d (%s)\n",
tmp,
199 printf(
"Using %d iterations of c += a*b\n",
NUM_FLOPS / 10 );
201 (
"-------------------------------------------------------------------------------------------\n" );
204 (
"Test: 1 2 3 4 5 6\n" );
205 printf(
"%s %12lld %12s %12s %12lld %12s %12lld\n",
"PAPI_LD_INS: ",
207 "------", (
values[5] )[0] );
208 printf(
"%s %12s %12lld %12s %12s %12lld %12lld\n",
"PAPI_SR_INS: ",
209 "------", (
values[1] )[0],
"------",
"------",
211 printf(
"%s %12s %12s %12lld %12lld %12lld %12s\n",
"PAPI_LST_INS:",
213 (
values[4] )[0],
"------" );
215 (
"-------------------------------------------------------------------------------------------\n" );
217 printf(
"Test 1: PAPI_LD_INS only.\n" );
218 printf(
"Test 2: PAPI_SR_INS only.\n" );
219 printf(
"Test 3: PAPI_LST_INS only.\n" );
220 printf(
"Test 4: PAPI_LD_INS and PAPI_LST_INS.\n" );
221 printf(
"Test 5: PAPI_SR_INS and PAPI_LST_INS.\n" );
222 printf(
"Test 6: PAPI_LD_INS and PAPI_SR_INS.\n" );
224 (
"Verification: Values within each column should be the same.\n" );
225 printf(
" R3C3 ~= (R1C1 + R2C2) ~= all other entries.\n" );
static const PAPI_hw_info_t * hw_info
add PAPI preset or native hardware event to an event set
Create a new empty PAPI EventSet.
get information about the system hardware
Get PAPI library or event set options.
initialize the PAPI library.
removes a hardware event from a PAPI event set.
Start counting hardware events in an event set.
Stop counting hardware events in an event set.
#define PAPI_VENDOR_INTEL
static long long values[NUM_EVENTS]
Return codes and api definitions.
int tests_quiet(int argc, char **argv)
char * stringify_all_domains(int domains)
char * stringify_granularity(int granularity)
void PAPI_NORETURN test_fail(const char *file, int line, const char *call, int retval)
long long ** allocate_test_space(int num_tests, int num_events)
void PAPI_NORETURN test_pass(const char *filename)
void PAPI_NORETURN test_skip(const char *file, int line, const char *call, int retval)