home *** CD-ROM | disk | FTP | other *** search
- /*
- * This file is part of the Livermore Loops transliteration into C.
- * Copyright (C) 1991 by Martin Fouts
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 1, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- */
-
- /*
- * LLNL Fortran kernels, transliterated into C
- */
-
- #define PASSES 100
-
- #include <stdio.h>
- #include "types.h"
- #include "data.h"
- #include "patchlevel.h"
-
- long int DoTest = 0xFFFFFF; /* Default: Run tests 1-24 */
- #ifdef COMPUTER
- Charp komput = COMPUTER;
- #else
- Charp komput = "Generic";
- #endif
- #ifdef COMPILER
- Charp kompil = COMPILER;
- #else
- Charp kompil = "Generic";
- #endif
-
- Void kernel();
- Void report();
-
- main(argc,argv)
- int argc;
- Charp argv[];
- {
- Int iout = 6;
- Int lset;
- int i;
- int cerr = 0;
- int pflag = 0;
- int tflag = 0;
- long int tests = 0;
- Float tock, tick();
-
- in_lp = PASSES;
-
- fprintf(stderr, "lloops: version 0.%d\n", PATCHLEVEL);
-
- for (i = 1; i < argc; i++) {
- if (argv[i][0] != '-') {
- fprintf(stderr,"Extra argument (%s) ignored.\n", argv[i]);
- cerr++;
- continue;
- }
- switch (argv[i][1]) {
- case 'p':
- if (pflag) {
- fprintf(stderr,"Multiple -p ignored.\n");
- cerr++;
- } else {
- pflag++;
- if (i == argc - 1) {
- fprintf(stderr,"-p takes argument\n");
- cerr++;
- } else {
- in_lp = atoi(argv[++i]);
- if (in_lp < 1) {
- fprintf(stderr,"Nonpositive pass count!\n");
- cerr++;
- }
- }
- }
- break;
- case 't':
- if (tflag) {
- fprintf(stderr,"Multiple -t ignored.\n");
- cerr++;
- } else {
- tflag++;
- if (i == argc - 1) {
- fprintf(stderr,"-t takes argument\n");
- cerr++;
- } else {
- sscanf(argv[++i],"%x",&tests);
- DoTest = tests;
- }
- }
- break;
- default:
- fprintf(stderr,"Illegal option (%s) ignored.\n", argv[i]);
- cerr++;
- break;
- }
- }
-
- if (cerr) {
- fprintf(stderr,"Usage: %s [-p passes] [-t tests]\n", argv[0]);
- exit(1);
- }
-
- for (lset = 0; lset < 3; lset++) {
- tock = tick(iout, lset);
- kernel();
- report(iout, (Int)24, tock, komput, kompil);
- }
-
- exit(0);
- }
-