124 for (
i = 0;
i < 10;
i++ ) {
163 for ( j = 0; j < 3; j++ ) {
167 for (
i = 0;
i < 10;
i++ ) {
168 for ( j = 0; j < 3; j++ ) {
171 if ( max[j] <
values[(
i * 3 ) + j][0] )
172 max[j] =
values[(
i * 3 ) + j][0];
173 sum[j] +=
values[(
i * 3 ) + j][0];
178 printf(
"Test case 10: start, stop for derived event %s.\n",
180 printf(
"--------------------------------------------------------\n" );
182 printf(
"Default domain is: %d (%s)\n",
tmp,
185 printf(
"Default granularity is: %d (%s)\n",
tmp,
187 printf(
"Using %d iterations of c += a*b\n",
ITERS );
188 printf(
"Repeated 10 times\n" );
190 (
"-------------------------------------------------------------------------\n" );
201 printf(
"Test type : %12s%13s%13s\n",
"min",
"max",
"sum" );
206 (
"-------------------------------------------------------------------------\n" );
207 printf(
"Verification:\n" );
208 #if defined(sun) && defined(sparc) 209 printf(
TAB1,
"Sum 1 approximately equals sum 2 - sum 3 or",
210 ( sum[1] - sum[2] ) );
212 printf(
TAB1,
"Sum 1 approximately equals sum 2 + sum 3 or",
213 ( sum[1] + sum[2] ) );
218 long long tmin, tmax;
220 #if defined(sun) && defined(sparc) 221 tmax = (
long long ) ( sum[1] - sum[2] );
223 tmax = (
long long ) ( sum[1] + sum[2] );
227 printf(
"percent error: %f\n",
228 ((
float ) abs( (
int ) ( tmax - sum[0] ) ) /
229 (
float) sum[0] ) * 100.0 );
231 tmin = (
long long ) ( (
double ) tmax * 0.8 );
232 tmax = (
long long ) ( (
double ) tmax * 1.2 );
233 if ( sum[0] > tmax || sum[0] < tmin ) {
int PAPI_stop(int EventSet, long long *values)
void test_pass(const char *filename)
char * stringify_granularity(int granularity)
void test_skip(const char *file, int line, const char *call, int retval)
int PAPI_library_init(int version)
char * stringify_all_domains(int domains)
int PAPI_get_opt(int option, PAPI_option_t *ptr)
void do_misses(int n, int bytes)
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_start(int EventSet)
static long long values[NUM_EVENTS]
long long ** allocate_test_space(int num_tests, int num_events)
int remove_test_events(int *EventSet, int mask)
int add_test_events(int *number, int *mask, int allow_derived)