34main(
int argc,
char **argv )
43#if !defined(ITANIUM2) && !defined(ITANIUM3)
44 test_skip( __FILE__, __LINE__,
"Currently only works on itanium2", 0 );
55 printf(
"Static array addresses: %p %p %p\n", &
array1, &
array2,
66 test_fail( __FILE__, __LINE__,
"PAPI_get_hardware_info", 2 );
69 if ( prginfo == NULL )
70 test_fail( __FILE__, __LINE__,
"PAPI_get_executable_info", 1 );
72#if defined(linux) && defined(__ia64__)
90 test_fail( __FILE__, __LINE__,
"PAPI_assign_eventset_component",
95 (
"\n\nMeasure loads and stores on the pointers to the allocated arrays\n" );
96 printf(
"Expected loads: %d; Expected stores: 0\n",
NUM * 2 );
98 (
"These loads result from accessing the pointers to compute array addresses.\n" );
100 (
"They will likely disappear with higher levels of optimization.\n" );
107 (
"\n\nMeasure loads and stores on the allocated arrays themselves\n" );
108 printf(
"Expected loads: %d; Expected stores: %d\n",
NUM,
NUM );
114 printf(
"\n\nMeasure loads and stores on the static arrays\n" );
116 (
"These values will differ from the expected values by the size of the offsets.\n" );
117 printf(
"Expected loads: %d; Expected stores: %d\n",
NUM,
NUM );
150 test_fail( __FILE__, __LINE__,
"PAPI_set_opt(PAPI_DATA_ADDRESS)",
171 (
"Requested Start Address: %p; Start Offset: %#5x; Actual Start Address: %p\n",
175 (
"Requested End Address: %p; End Offset: %#5x; Actual End Address: %p\n",
191 printf(
"%s: %lld\n",
event_name[index], value );
201 parray1 = (
int * ) malloc(
NUM *
sizeof (
int ) );
203 test_fail( __FILE__, __LINE__,
"No memory available!\n", 0 );
206 parray2 = (
int * ) malloc(
NUM *
sizeof (
int ) );
208 test_fail( __FILE__, __LINE__,
"No memory available!\n", 0 );
211 parray3 = (
int * ) malloc(
NUM *
sizeof (
int ) );
213 test_fail( __FILE__, __LINE__,
"No memory available!\n", 0 );
static const PAPI_hw_info_t * hw_info
add PAPI preset or native hardware event to an event set
Assign a component index to an existing but empty EventSet.
Empty and destroy an EventSet.
Create a new empty PAPI EventSet.
Empty and destroy an EventSet.
Convert a name to a numeric hardware event code.
Get the executable's address space info.
get information about the system hardware
initialize the PAPI library.
removes a hardware event from a PAPI event set.
Set PAPI library or event set options.
Start counting hardware events in an event set.
Stop counting hardware events in an event set.
static void init_array(void)
static int do_malloc_work(long loop)
static int do_static_work(long loop)
static void measure_event(int index, PAPI_option_t *option)
static void measure_load_store(vptr_t start, vptr_t end)
char event_name[2][PAPI_MAX_STR_LEN]
#define PAPI_DATA_ADDRESS
static struct timeval start
Return codes and api definitions.
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)
get the executable's info
A pointer to the following is passed to PAPI_set/get_opt()
PAPI_addr_range_option_t addr