8long long int low_mark[10] = { 0LL, 2LL, 2LL, 7LL, 21LL, 29LL, 29LL, 29LL, 29LL, 34LL};
9long long int high_mark[10] = { 1LL, 1LL, 2LL, 3LL, 4LL, 8LL, 9LL, 9LL, 9LL, 13LL};
10long long int tot_iter[10] = { 2LL, 9LL, 13LL, 33LL, 83LL, 122LL, 126LL, 130LL, 135LL, 176LL};
11double comp_val[10] = {0.653676, 3.160483, 4.400648, 10.286250, 25.162759, 36.454895, 37.965891, 39.680220, 41.709039, 53.453990};
17int main(
int argc,
char **argv){
19 int discrepancies = 0;
21 long long counter_values[4];
24 if( (argc > 1) && !strcmp(argv[1],
"-verbose") )
33 test_fail( __FILE__, __LINE__,
"PAPI_start", ret );
44 test_fail( __FILE__, __LINE__,
"PAPI_read", ret );
48 dbl_ptr = (
double *)&counter_values[3];
49 if(
be_verbose ) printf(
"Low Mark=%lld, High Mark=%lld, Total Iterations=%lld, Comp. Value=%lf\n",
50 counter_values[0], counter_values[1], counter_values[2], *dbl_ptr);
64 test_fail( __FILE__, __LINE__,
"PAPI_stop", ret );
70 test_fail( __FILE__, __LINE__,
"SDE counter values are wrong!", 0 );
82 test_fail( __FILE__, __LINE__,
"PAPI_library_init", ret );
86 test_fail( __FILE__, __LINE__,
"PAPI_create_eventset", ret );
90 test_fail( __FILE__, __LINE__,
"PAPI_add_named_event", ret );
94 test_fail( __FILE__, __LINE__,
"PAPI_add_named_event", ret );
98 test_fail( __FILE__, __LINE__,
"PAPI_add_named_event", ret );
102 test_fail( __FILE__, __LINE__,
"PAPI_add_named_event", ret );
long long int high_mark[10]
void setup_PAPI(int *event_set)
double simple_compute(double x)
long long int low_mark[10]
long long int tot_iter[10]
add PAPI preset or native hardware event by name to an EventSet
Create a new empty PAPI EventSet.
initialize the PAPI library.
Read hardware counters from an event set.
Start counting hardware events in an event set.
Stop counting hardware events in an event set.
Return codes and api definitions.
void PAPI_NORETURN test_fail(const char *file, int line, const char *call, int retval)
void PAPI_NORETURN test_pass(const char *filename)