Go to the source code of this file.
◆ cclib_do_more_work()
| void cclib_do_more_work |
( |
void |
| ) |
|
Definition at line 66 of file Lib_With_Created_Counter.c.
66 {
68
69 for(
i=0;
i<500*1000;
i++){
71 double r = (1.0*
result)/(1.0*INT_MAX);
74 }
75
77 (void)usleep(1);
78 }
79
80 return;
81}
int papi_sde_inc_counter(papi_handle_t cntr_handle, long long int increment)
◆ cclib_do_work()
| void cclib_do_work |
( |
void |
| ) |
|
Definition at line 49 of file Lib_With_Created_Counter.c.
49 {
51
52 for(
i=0;
i<100*1000;
i++){
54 double r = (1.0*
result)/(1.0*INT_MAX);
57 }
58
60 (void)usleep(1);
61 }
62
63 return;
64}
◆ cclib_init()
Definition at line 35 of file Lib_With_Created_Counter.c.
35 {
37
40
45
46 return;
47}
static const char * event_names[1]
papi_handle_t papi_sde_init(const char *name_of_library)
int papi_sde_create_counter(papi_handle_t handle, const char *event_name, int cntr_mode, void **cntr_handle)
◆ main()
| int main |
( |
int |
argc, |
|
|
char ** |
argv |
|
) |
| |
Definition at line 16 of file Created_Counter_Driver.c.
16 {
18 int discrepancies = 0;
19 long long counter_values[1] = {0};
20
21 if( (argc > 1) && !strcmp(argv[1], "-verbose") )
23
25
27
28
30 test_fail( __FILE__, __LINE__,
"PAPI_start", ret );
31 }
32
34
36
37
39 test_fail( __FILE__, __LINE__,
"PAPI_accum", ret );
40 }
41 if(
be_verbose ) printf(
"Epsilon count in cclib_do_work(): %lld\n",counter_values[0]);
43 discrepancies++;
44 }
45 counter_values[0] = 0;
46
47 }
48
49
51 test_fail( __FILE__, __LINE__,
"PAPI_stop", ret );
52 }
53
54 if( !discrepancies )
56 else
57 test_fail( __FILE__, __LINE__,
"SDE counter values are wrong!", 0 );
58
59
60
61 return 0;
62}
void setup_PAPI(int *event_set)
long long int epsilon_v[10]
Accumulate and reset counters in an EventSet.
Start counting hardware events in an event set.
Stop counting hardware events in an event set.
void PAPI_NORETURN test_fail(const char *file, int line, const char *call, int retval)
void PAPI_NORETURN test_pass(const char *filename)
◆ setup_PAPI()
| void setup_PAPI |
( |
int * |
event_set | ) |
|
Definition at line 65 of file Created_Counter_Driver.c.
65 {
66 int ret;
67
69 test_fail( __FILE__, __LINE__,
"PAPI_library_init", ret );
70 }
71
73 test_fail( __FILE__, __LINE__,
"PAPI_create_eventset", ret );
74 }
75
77 test_fail( __FILE__, __LINE__,
"PAPI_add_named_event", ret );
78 }
79
80 return;
81}
add PAPI preset or native hardware event by name to an EventSet
Create a new empty PAPI EventSet.
initialize the PAPI library.
◆ be_verbose
◆ epsilon_v
| long long int epsilon_v[10] = {14LL, 11LL, 8LL, 13LL, 8LL, 10LL, 12LL, 11LL, 6LL, 8LL} |