/* ** cleanbench.c */ /******************************************* ** BYTEmark (tm) ** ** BYTE MAGAZINE'S NATIVE MODE BENCHMARKS ** ** FOR CPU/FPU ** ** ver 2.0 ** ** Rick Grehan, BYTE Magazine ** ******************************************** ** REVISION HISTORY FOR BENCHMARKS ** 9/94 -- First beta. --RG ** 12/94 -- Bug discovered in some of the integer routines ** (IDEA, Huffman,...). Routines were not accurately counting ** the number of loops. Fixed. --RG (Thanks to Steve A.) ** 12/94 -- Added routines to calculate and display index ** values. Indexes based on DELL XPS 90 (90 MHz Pentium). ** 1/95 -- Added Mac time manager routines for more accurate ** timing on Macintosh (said to be good to 20 usecs) -- RG ** 1/95 -- Re-did all the #defines so they made more ** sense. See NMGLOBAL.H -- RG ** 3/95 -- Fixed memory leak in LU decomposition. Did not ** invalidate previous results, just made it easier to run.--RG ** 3/95 -- Added TOOLHELP.DLL timing routine to Windows timer. --RG ** 10/95 -- Added memory array & alignment; moved memory ** allocation out of LU Decomposition -- RG ** ** DISCLAIMER ** The source, executable, and documentation files that comprise ** the BYTEmark benchmarks are made available on an "as is" basis. ** This means that we at BYTE Magazine have made every reasonable ** effort to verify that the there are no errors in the source and ** executable code. We cannot, however, guarantee that the programs ** are error-free. Consequently, McGraw-HIll and BYTE Magazine make ** no claims in regard to the fitness of the source code, executable ** code, and documentation of the BYTEmark. ** Furthermore, BYTE Magazine, McGraw-Hill, and all employees ** of McGraw-Hill cannot be held responsible for any damages resulting ** from the use of this code or the results obtained from using ** this code. */ #include #include #include #include #include #include "nmglobal.h" #include "cleanbench.h" #include "hardware.h" /************* **** main **** *************/ int main(int argc, char *argv[]) { double bmean; /* Benchmark mean */ double bstdev; /* Benchmark stdev */ double lx_memindex = 1.0; /* Linux memory index (mainly integer operations)*/ double lx_intindex = 1.0; /* Linux integer index */ double lx_fpindex = 1.0; /* Linux floating-point index */ double intindex = 1.0; /* Integer index */ double fpindex = 1.0; /* Floating-point index */ unsigned long bnumrun; /* # of runs */ int i; /* Index */ /* ** We presume all tests will be run unless told ** otherwise */ for (i = 0; i < NUMTESTS; i++) { tests_to_do[i] = TRUE; } /* ** Initialize test data structures to default ** values. */ global_numsortstruct.arraysize=NUMARRAYSIZE; global_strsortstruct.arraysize=STRINGARRAYSIZE; global_bitopstruct.bitfieldarraysize=BITFARRAYSIZE; global_emfloatstruct.arraysize=EMFARRAYSIZE; global_ideastruct.arraysize=IDEAARRAYSIZE; global_huffstruct.arraysize=HUFFARRAYSIZE; puts("BYTEmark* Native Mode Benchmark ver. 2 (10/95)"); puts("Index-split by Andrew D. Balsa (11/97)"); puts("Linux/Unix* port by Uwe F. Mayer (12/96,11/97)"); puts("\nTEST : Iterations/sec. : Old Index : New Index"); puts(" : : Pentium 90* : AMD K6/233*"); puts("--------------------:------------------:-------------:------------"); for(i=0;i30)) { puts("Internal error: calc_confidence called with an illegal number of scores"); return(-1); } /* ** First calculate mean. */ *smean=(double)0.0; for(i=0;i