Go to the source code of this file.
◆ NUM
◆ do_malloc_work()
| static int do_malloc_work |
( |
long |
loop | ) |
|
|
static |
◆ do_static_work()
| static int do_static_work |
( |
long |
loop | ) |
|
|
static |
◆ init_array()
| static void init_array |
( |
void |
| ) |
|
|
static |
Definition at line 199 of file data_range.c.
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 );
void test_fail(const char *file, int line, const char *call, int retval)
◆ main()
| int main |
( |
int |
argc, |
|
|
char ** |
argv |
|
) |
| |
Definition at line 34 of file data_range.c.
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 );
char event_name[2][PAPI_MAX_STR_LEN]
void test_pass(const char *filename)
get the executable's info
int PAPI_event_name_to_code(const char *in, int *out)
void test_skip(const char *file, int line, const char *call, int retval)
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)
const PAPI_hw_info_t * PAPI_get_hardware_info(void)
static const PAPI_hw_info_t * hw_info
◆ measure_event()
Definition at line 158 of file data_range.c.
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 );
char event_name[2][PAPI_MAX_STR_LEN]
int PAPI_stop(int EventSet, long long *values)
int PAPI_add_event(int EventSet, int EventCode)
static int do_malloc_work(long loop)
int PAPI_remove_event(int EventSet, int EventCode)
PAPI_addr_range_option_t addr
void test_fail(const char *file, int line, const char *call, int retval)
int PAPI_start(int EventSet)
static int do_static_work(long loop)
◆ measure_load_store()
Definition at line 139 of file data_range.c.
150 test_fail( __FILE__, __LINE__,
"PAPI_set_opt(PAPI_DATA_ADDRESS)",
#define PAPI_DATA_ADDRESS
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)
PAPI_addr_range_option_t addr
void test_fail(const char *file, int line, const char *call, int retval)
static void measure_event(int index, PAPI_option_t *option)
◆ array1
◆ array2
◆ array3
◆ event_name
◆ EventSet
◆ PAPI_event
◆ parray1
◆ parray2
◆ parray3