Go to the source code of this file.
|
| volatile double | t1 = 0.8 |
| |
| volatile double | t2 = 0.9 |
| |
| volatile double | a = 0.5 |
| |
| volatile double | b = 2.2 |
| |
◆ DO_FLOPS1
◆ DO_FLOPS2
◆ ERROR_RETURN
| #define ERROR_RETURN |
( |
|
retval | ) |
{ fprintf(stderr, "Error %d %s:line %d: \n", retval,__FILE__,__LINE__); exit(retval); } |
◆ NUM_FLOPS
| #define NUM_FLOPS 20000000 |
◆ NUM_ITERS
◆ THRESHOLD
◆ do_both()
◆ do_flops1()
◆ do_flops2()
◆ main()
| int main |
( |
int |
argc, |
|
|
char ** |
argv |
|
) |
| |
Definition at line 50 of file examples/sprofile.c.
55 unsigned short *profbuf2;
56 unsigned short *profbuf3;
67 printf(
"Library initialization error! \n");
76 length = (end -
start)/
sizeof(
unsigned short) *
sizeof(
unsigned short);
77 printf(
"start= %p end =%p \n",
start, end);
85 profbuf2 = (
unsigned short *) malloc(
length);
89 memset(profbuf2, 0x00,
length );
91 profbuf3 = (
unsigned short *) malloc(1 *
sizeof(
unsigned short));
95 memset(profbuf3, 0x00, 1 *
sizeof(
unsigned short));
101 fprintf(stderr,
"do_flops is at %p %lx\n", &
do_flops2, strtoul(sprof[0].pr_off,NULL,0));
108 fprintf(stderr,
"do_flops1 is at %p %lx\n", &
do_flops1, strtoul(sprof[1].pr_off,NULL,0));
151 printf(
"Test case: PAPI_sprofil()\n");
152 printf(
"---------Buffer 1--------\n");
158 printf(
"---------Buffer 2--------\n");
162 printf(
"%#lx\t%d\n", strtoul(
DO_FLOPS1,NULL,0) + 2 *
i, profbuf2[
i]);
164 printf(
"-------------------------\n");
165 printf(
"%u samples fell outside the regions.\n", *profbuf3);
int PAPI_stop(int EventSet, long long *values)
int PAPI_add_event(int EventSet, int EventCode)
get the executable's info
#define PAPI_PROFIL_POSIX
static struct timeval start
int PAPI_sprofil(PAPI_sprofil_t *prof, int profcnt, int EventSet, int EventCode, int threshold, int flags)
int PAPI_library_init(int version)
const PAPI_exe_info_t * PAPI_get_executable_info(void)
PAPI_address_map_t address_info
int PAPI_create_eventset(int *EventSet)
#define ERROR_RETURN(retval)
int PAPI_start(int EventSet)
static long long values[NUM_EVENTS]
◆ t1
◆ t2