21 main(
int argc,
char **argv )
45 if (!
quiet) printf(
"This example program requries the architecture to " 46 "support 2 simultaneous hardware events...shutting down.\n" );
47 test_skip( __FILE__, __LINE__,
"PAPI_num_counters", 1 );
51 printf(
"Number of hardware counters supported: %d\n",
num_events );
65 for ( j = 0; j <
NCOLS1; j++ )
66 p[
i][j] =
i * j * 1.0;
69 for ( j = 0; j <
NCOLS2; j++ )
70 q[
i][j] =
i * j * 1.0;
73 for ( j = 0; j <
NCOLS2; j++ )
74 r[
i][j] =
i * j * 1.0;
89 for ( j = 0; j <
NCOLS2; j++ )
90 for ( k = 0; k <
NCOLS1; k++ )
91 r[
i][j] = r[
i][j] + p[
i][k] * q[k][j];
105 printf(
TAB1,
"TOT Instructions:",
values[0] );
107 printf(
TAB1,
"FP Instructions:",
values[0] );
120 2 * (
long long ) (
NROWS1 ) * (
long long ) (
NCOLS2 ) *
122 if ( abs( (
int )
values[0] - ( int )
tmp ) > ( double )
tmp * 0.05 ) {
125 if ( abs( (
int )
values[0] - ( int )
tmp ) >
126 ( double )
tmp * 0.05 ) {
127 printf(
"\n" TAB1,
"Expected operation count: ", 2 *
tmp );
128 printf(
TAB1,
"Or possibly (using FMA): ",
tmp );
131 "Unexpected FLOP count (check vector operations)",
void test_pass(const char *filename)
int main(int argc, char **argv)
Return codes and api definitions.
void test_skip(const char *file, int line, const char *call, int retval)
int PAPI_stop_counters(long long *values, int array_len)
int PAPI_query_event(int EventCode)
int tests_quiet(int argc, char **argv)
void test_fail(const char *file, int line, const char *call, int retval)
int PAPI_read_counters(long long *values, int array_len)
int PAPI_num_counters(void)
int PAPI_start_counters(int *events, int array_len)
static long long values[NUM_EVENTS]