Go to the source code of this file.
◆ NUM_RUNS
◆ main()
| int main |
( |
int |
argc, |
|
|
char ** |
argv |
|
) |
| |
Definition at line 226 of file papi_tot_ins.c.
237 printf(
"\nThis test checks that the \"PAPI_TOT_INS\" generalized " 238 "event is working.\n");
251 if (!
quiet) printf(
"\n");
void test_pass(const char *filename)
static void test_million(int quiet)
int PAPI_library_init(int version)
static void test_fldcw(int quiet)
int tests_quiet(int argc, char **argv)
void test_fail(const char *file, int line, const char *call, int retval)
static void test_rep(int quiet)
◆ test_fldcw()
| static void test_fldcw |
( |
int |
quiet | ) |
|
|
static |
Definition at line 99 of file papi_tot_ins.c.
103 #if defined(__i386__) || (defined __x86_64__) 104 int i,result,ins_result;
107 long long count,high=0,low=0,
total=0,average=0;
111 printf(
"\nTesting a fldcw loop of 900,000 instructions (%d times):\n",
117 test_fail( __FILE__, __LINE__,
"PAPI_create_eventset", result );
122 test_fail( __FILE__, __LINE__,
"adding PAPI_TOT_INS", result );
135 test_fail( __FILE__, __LINE__,
"Code unimplemented", 1 );
139 test_fail( __FILE__, __LINE__,
"Unexpected error on read", 1 );
151 if ((error > 1.0) || (error<-1.0)) {
154 printf(
"On Pentium 4 machines, the fldcw instruction counts as 2.\n");
155 printf(
"This will lead to an overcount of 22%%\n");
157 test_fail( __FILE__, __LINE__,
"Error too high", 1 );
int PAPI_stop(int EventSet, long long *values)
int PAPI_reset(int EventSet)
double display_error(long long average, long long high, long long low, long long expected, int quiet)
#define CODE_UNIMPLEMENTED
int PAPI_add_named_event(int EventSet, const char *EventName)
int PAPI_create_eventset(int *EventSet)
void test_fail(const char *file, int line, const char *call, int retval)
int instructions_fldcw(void)
int PAPI_start(int EventSet)
◆ test_million()
| static void test_million |
( |
int |
quiet | ) |
|
|
static |
Definition at line 31 of file papi_tot_ins.c.
33 int i,result,ins_result;
35 long long count,high=0,low=0,
total=0,average=0;
40 printf(
"\nTesting a loop of 1 million instructions (%d times):\n",
46 test_fail( __FILE__, __LINE__,
"PAPI_create_eventset", result );
51 if (!
quiet) printf(
"Could not add PAPI_TOT_INS\n");
52 test_skip( __FILE__, __LINE__,
"adding PAPI_TOT_INS", result );
65 fprintf(stderr,
"\tCode unimplemented\n");
66 test_skip( __FILE__, __LINE__,
"unimplemented", 0);
71 "reading PAPI_TOT_INS", result );
83 if ((error > 1.0) || (error<-1.0)) {
88 printf(
"If PPC is off by 50%%, this might be due to\n" 89 "\"folded\" branch instructions on PPC32\n");
92 test_fail( __FILE__, __LINE__,
"validation", result );
int PAPI_stop(int EventSet, long long *values)
int PAPI_reset(int EventSet)
double display_error(long long average, long long high, long long low, long long expected, int quiet)
#define CODE_UNIMPLEMENTED
void test_skip(const char *file, int line, const char *call, int retval)
int PAPI_add_named_event(int EventSet, const char *EventName)
int instructions_million(void)
int PAPI_create_eventset(int *EventSet)
void test_fail(const char *file, int line, const char *call, int retval)
int PAPI_start(int EventSet)
◆ test_rep()
| static void test_rep |
( |
int |
quiet | ) |
|
|
static |
Definition at line 165 of file papi_tot_ins.c.
169 #if defined(__i386__) || (defined __x86_64__) 170 int i,result,ins_result;
173 long long count,high=0,low=0,
total=0,average=0;
177 printf(
"\nTesting a 16k rep loop (%d times):\n",
NUM_RUNS);
182 test_fail( __FILE__, __LINE__,
"PAPI_create_eventset", result );
187 test_fail( __FILE__, __LINE__,
"adding PAPI_TOT_INS", result );
200 fprintf(stderr,
"\tCode unimplemented\n");
201 test_fail( __FILE__, __LINE__,
"Code unimplemented", 1 );
205 test_fail( __FILE__, __LINE__,
"Unexpected error on read", 1 );
217 if ((error > 10.0) || (error<-10.0)) {
219 printf(
"Instruction count off by more than 10%%\n");
221 test_fail( __FILE__, __LINE__,
"Error too high", 1 );
int PAPI_stop(int EventSet, long long *values)
int PAPI_reset(int EventSet)
double display_error(long long average, long long high, long long low, long long expected, int quiet)
#define CODE_UNIMPLEMENTED
int PAPI_add_named_event(int EventSet, const char *EventName)
int PAPI_create_eventset(int *EventSet)
int instructions_rep(void)
void test_fail(const char *file, int line, const char *call, int retval)
int PAPI_start(int EventSet)