34 main(
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 );
char event_name[2][PAPI_MAX_STR_LEN]
int PAPI_stop(int EventSet, long long *values)
int main(int argc, char **argv)
void test_pass(const char *filename)
int PAPI_add_event(int EventSet, int EventCode)
static int do_malloc_work(long loop)
int PAPI_remove_event(int EventSet, int EventCode)
#define PAPI_DATA_ADDRESS
get the executable's info
int PAPI_event_name_to_code(const char *in, int *out)
A pointer to the following is passed to PAPI_set/get_opt()
static struct timeval start
int PAPI_set_opt(int option, PAPI_option_t *ptr)
Return codes and api definitions.
void test_skip(const char *file, int line, const char *call, int retval)
PAPI_addr_range_option_t addr
int PAPI_library_init(int version)
const PAPI_exe_info_t * PAPI_get_executable_info(void)
int PAPI_cleanup_eventset(int EventSet)
int PAPI_assign_eventset_component(int EventSet, int cidx)
int PAPI_create_eventset(int *EventSet)
static void measure_load_store(caddr_t start, caddr_t end)
int tests_quiet(int argc, char **argv)
void test_fail(const char *file, int line, const char *call, int retval)
int PAPI_destroy_eventset(int *EventSet)
static void init_array(void)
int PAPI_start(int EventSet)
static void measure_event(int index, PAPI_option_t *option)
const PAPI_hw_info_t * PAPI_get_hardware_info(void)
static const PAPI_hw_info_t * hw_info
static int do_static_work(long loop)