54 #define NUM_FLOPS 20000000 97 printf(
"-------------------------------------------------------------------------\n" );
98 if (sleep_test) printf(
"Sleeping for 2s\n");
99 else printf(
"Using %d iterations of c += a*b\n", numflops );
100 printf(
"-------------------------------------------------------------------------\n" );
102 printf(
"PAPI_TOT_CYC : \t%10lld\n",
values[0] );
103 printf(
"PAPI_REF_CYC : \t%10lld\n",
values[1] );
104 printf(
"Real usec : \t%10lld\n",
elapsed_us );
106 printf(
"Virt usec : \t%10lld\n", elapsed_virt_us );
107 printf(
"Virt cycles (estimate) : \t%10lld\n", elapsed_virt_cyc );
110 printf(
"-------------------------------------------------------------------------\n" );
116 printf(
"Verification: PAPI_REF_CYC should be much lower than real_usec\n");
119 if (!
quiet) printf(
"PAPI_REF_CYC too high!\n");
120 test_fail( __FILE__, __LINE__,
"PAPI_REF_CYC too high", 0 );
128 printf(
"Verification: real_cyc should be roughly PAPI_REF_CYC\n");
129 printf(
" real_usec should be roughly virt_usec (on otherwise idle system)\n");
136 if ((cycles_error>10.0) || (cycles_error<-10.0)) {
137 if (!
quiet) printf(
"Error of %.2f%%\n",cycles_error);
138 test_fail( __FILE__, __LINE__,
"PAPI_REF_CYC validation", 0 );
145 if ((cycles_error>10.0) || (cycles_error<-10.0)) {
146 if (!
quiet) printf(
"Error of %.2f%%\n",cycles_error);
147 test_warn( __FILE__, __LINE__,
"real_us validation", 0 );
172 if (!
quiet) printf(
"No PAPI_REF_CYC available\n");
174 "PAPI_REF_CYC is not defined on this platform.", 0);
187 "PAPI_add_named_event: PAPI_TOT_CYC",
retval );
194 "PAPI_add_events: PAPI_REF_CYC",
retval );
198 printf(
"Test case sleeping: " 199 "Look at TOT and REF cycles.\n");
206 printf(
"\nTest case busy:\n" );
int PAPI_stop(int EventSet, long long *values)
void test_pass(const char *filename)
long long PAPI_get_virt_usec(void)
int main(int argc, char **argv)
static void work(int EventSet, int sleep_test, int quiet)
long long PAPI_get_virt_cyc(void)
void test_warn(const char *file, int line, const char *call, int retval)
Return codes and api definitions.
void test_skip(const char *file, int line, const char *call, int retval)
int PAPI_add_named_event(int EventSet, const char *EventName)
int PAPI_library_init(int version)
int PAPI_query_named_event(const char *EventName)
int PAPI_create_eventset(int *EventSet)
long long PAPI_get_real_usec(void)
int tests_quiet(int argc, char **argv)
void test_fail(const char *file, int line, const char *call, int retval)
long long PAPI_get_real_cyc(void)
int PAPI_start(int EventSet)
static long long values[NUM_EVENTS]