199 extern void dummy(
void * );
201 float aa, *
a=NULL, *
b=NULL, *
c=NULL, *
x=NULL, *
y=NULL;
202 double aad, *ad=NULL, *bd=NULL, *cd=NULL, *xd=NULL, *yd=NULL;
207 int double_precision = 0;
216 for (
i = 0;
i < argc;
i++ ) {
217 if ( strstr( argv[
i],
"-i" ) )
219 else if ( strstr( argv[
i],
"-f" ) )
221 else if ( strstr( argv[
i],
"-v" ) )
223 else if ( strstr( argv[
i],
"-m" ) )
225 else if ( strstr( argv[
i],
"-e" ) ) {
226 if ( ( argv[
i + 1] == NULL ) || ( strlen( argv[
i + 1] ) == 0 ) ) {
230 strncpy( papi_event_str, argv[
i + 1],
sizeof ( papi_event_str ) - 1);
231 papi_event_str[
sizeof ( papi_event_str )-1] =
'\0';
233 }
else if ( strstr( argv[
i],
"-d" ) )
234 double_precision = 1;
235 else if ( strstr( argv[
i],
"-h" ) ) {
242 if ( inner + vector + matrix == 0 )
243 inner = vector = matrix = 1;
250 printf(
"Initializing..." );
277 if (!
quiet) printf(
"\n" );
284 if (double_precision) {
285 xd = malloc(
INDEX5 *
sizeof(
double) );
286 yd = malloc(
INDEX5 *
sizeof(
double) );
291 x = malloc(
INDEX5 *
sizeof(
float) );
292 y = malloc(
INDEX5 *
sizeof(
float) );
301 for ( n = 0; n <
INDEX5; n++ ) {
302 if ( n <
INDEX1 || ( ( n + 1 ) % 50 ) == 0 ) {
305 if ( double_precision ) {
306 for (
i = 0;
i <= n;
i++ ) {
307 xd[
i] = ( double )
rand( ) * ( double ) 1.1;
308 yd[
i] = ( double )
rand( ) * ( double ) 1.1;
311 for (
i = 0;
i <= n;
i++ ) {
312 x[
i] = ( float )
rand( ) * ( float ) 1.1;
313 y[
i] = ( float )
rand( ) * ( float ) 1.1;
321 if ( double_precision ) {
323 dummy( (
void * ) &aad );
332 if (double_precision) {
344 if (double_precision) {
346 xd = malloc(
INDEX5 *
sizeof(
double) );
347 yd = malloc(
INDEX5 *
sizeof(
double) );
348 if ( !( ad && xd && yd ) )
352 x = malloc(
INDEX5 *
sizeof(
float) );
353 y = malloc(
INDEX5 *
sizeof(
float) );
354 if ( !(
a &&
x &&
y ) )
362 for ( n = 0; n <
INDEX5; n++ ) {
363 if ( n <
INDEX1 || ( ( n + 1 ) % 50 ) == 0 ) {
366 if ( double_precision ) {
367 for (
i = 0;
i <= n;
i++ ) {
369 xd[
i] = ( double )
rand( ) * ( double ) 1.1;
370 for ( j = 0; j <= n; j++ )
372 (
double )
rand( ) * ( double ) 1.1;
375 for (
i = 0;
i <= n;
i++ ) {
377 x[
i] = ( float )
rand( ) * ( float ) 1.1;
378 for ( j = 0; j <= n; j++ )
380 (
float )
rand( ) * ( float ) 1.1;
388 if ( double_precision ) {
390 dummy( (
void * ) yd );
399 if (double_precision) {
413 if (double_precision) {
417 if ( !( ad && bd && cd ) )
423 if ( !(
a &&
b &&
c ) )
432 for ( n = 0; n <
INDEX5; n++ ) {
433 if ( n <
INDEX1 || ( ( n + 1 ) % 50 ) == 0 ) {
436 if ( double_precision ) {
437 for (
i = 0;
i <= n * n + n;
i++ ) {
439 ad[
i] = ( double )
rand( ) * ( double ) 1.1;
440 bd[
i] = ( double )
rand( ) * ( double ) 1.1;
443 for (
i = 0;
i <= n * n + n;
i++ ) {
445 a[
i] = ( float )
rand( ) * ( float ) 1.1;
446 b[
i] = ( float )
rand( ) * ( float ) 1.1;
454 if ( double_precision ) {
465 if (double_precision) {
void test_pass(const char *filename)
int PAPI_add_event(int EventSet, int EventCode)
static void vector_double(int n, double *a, double *x, double *y)
static float inner_single(int n, float *x, float *y)
static void vector_single(int n, float *a, float *x, float *y)
int PAPI_event_name_to_code(const char *in, int *out)
static void matrix_single(int n, float *c, float *a, float *b)
static void matrix_double(int n, double *c, double *a, double *b)
void test_skip(const char *file, int line, const char *call, int retval)
int PAPI_library_init(int version)
static void resultline(int i, int j, int EventSet, int fail, int quiet)
static void print_help(char **argv)
static void headerlines(const char *title, int quiet)
int PAPI_create_eventset(int *EventSet)
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)
static double inner_double(int n, double *x, double *y)
static void reset_flops(const char *title, int EventSet)
static double b[MATRIX_SIZE][MATRIX_SIZE]
static double a[MATRIX_SIZE][MATRIX_SIZE]