/* ** nmglobal.h ** Global definitions for native mode benchmarks. ** ** BYTEmark (tm) ** BYTE's Native Mode Benchmarks ** Rick Grehan, BYTE Magazine ** ** Creation: ** Revision: 3/95;10/95 ** 10/95 - Added memory array & alignment -- 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. */ /* ** SYSTEM DEFINES */ #include /* +++ MEMORY +++ */ /* ** You must define ONLY ONE of the following identifiers ** to specify the mechanism for allocating memory: ** MALLOCMEM ** DOS16MEM ** MACMEM */ /* ** Define MALLOCMEM to use the standard malloc() call for ** memory. This is the default for most systems. */ #define MALLOCMEM /* ** Define DOS16MEM if you're running in the old 16-bit segmented ** model. This enables some fruity memory management routines ** required for that model. NOT defining this assumes that ** you're running in an environment that allows malloc() to ** get > 64K chunks of memory. */ /* #define DOS16MEM */ /* Define MACMEM to use the Mac's GetPtr call to allocate ** memory (instead of malloc()). */ /* #define MACMEM */ /* +++ TIMING +++ */ /* ** You must define ONLY ONE of the following identifiers to pick ** the timing routine used. ** CLOCKWCPS ** CLOCKWCT ** MACTIMEMGR ** WIN31TIMER */ /* ** Define CLOCKWCPS if you are using the clock() routine and the ** constant used as the divisor to determine seconds is ** CLOCKS_PER_SEC. This is the default in most cases. */ #define CLOCKWCPS /* ** Define CLOCKWCT if you are using the clock() routine and the ** constant used as the divisor to determine seconds is CLK_TCK */ /* #define CLOCKWCT */ /* ** Define MACTIMEMGR to use the Mac Time manager routines. ** You'll need to be running at least system 6.0.3 or ** better...extended time manager is recommended (system 7 or ** better). */ /* #define MACTIMEMGR */ /* ** Define WIN31TIMER to user the timing routines in TOOLHELP.DLL. ** Gets accuracy down to the millisecond. */ /* #define WIN31TIMER */ /* ** ERROR CODES */ #define ERROR_MEMORY 1 #define ERROR_MEMARRAY_FULL 2 #define ERROR_MEMARRAY_NFOUND 3 #define ERROR_FILECREATE 10 #define ERROR_FILEREAD 11 #define ERROR_FILEWRITE 12 #define ERROR_FILEOPEN 13 #define ERROR_FILESEEK 14 /* ** MINIMUM_TICKS ** ** This sets the default number of minimum ticks. ** It can, of course, be overridden by the input ** command file. ** This ultimately gets loaded into the variable ** global_min_ticks, which specifies the minimum ** number of ticks that must take place between ** a StartStopwatch() and StopStopwatch() call. ** The idea is to reduce error buildup. */ #define MINIMUM_TICKS 60 /* ** MINIMUM_SECONDS ** ** Minimum number of seconds to run each test. */ #define MINIMUM_SECONDS 5 /* ** MAXPOSLONG ** ** This is the maximum positive long. */ #ifdef _LP64 #define MAXPOSLONG 0x7FFFFFFFFFFFFFFFL #else #define MAXPOSLONG 0x7FFFFFFFL #endif /* ** OTHER DEFINES */ #ifndef MAC #define TRUE 1 #define FALSE 0 #endif /* ** Memory array size. Used in SYSSPEC for keeping track ** of re-aligned memory. */ #define MEM_ARRAY_SIZE 20 /***************** ** NUMERIC SORT ** *****************/ /* ** DEFINES */ /* ** The following constant, NUMNUMARRAYS (no, it is not a ** Peter Sellers joke) is the maximum number of arrays ** that can be built by the numeric sorting benchmark ** before it gives up. This maximum is dependent on the ** amount of memory in the system. */ /*#define NUMNUMARRAYS 1000*/ #define NUMNUMARRAYS 10000 /* ** The following constant NUMARRAYSIZE determines the ** default # of elements in each numeric array. Ordinarily ** this is something you shouldn't fool with, though as ** with most of the constants here, it is adjustable. */ #define NUMARRAYSIZE 8111L /* ** TYPEDEFS */ typedef struct { int adjust; /* Set adjust code */ unsigned long request_secs; /* # of seconds requested */ double sortspersec; /* # of sort iterations per sec */ unsigned short numarrays; /* # of arrays */ unsigned long arraysize; /* # of elements in array */ } SortStruct; /**************** ** STRING SORT ** ***************** ** Note: The string sort benchmark uses the same structure to ** communicate parameters as does the numeric sort benchmark. ** (i.e., SortStruct...see above. */ /* ** DEFINES */ /* ** The following constant STRINGARRAYSIZE determines ** the default # of bytes allocated to each string array. ** Though the actual size can be pre-set from the command ** file, this constant should be left unchanged. */ #define STRINGARRAYSIZE 8111L /************************ ** BITFIELD OPERATIONS ** ************************* */ /* ** DEFINES */ /* ** Following field sets the size of the bitfield array (in longs). */ #ifdef _LP64 #define BITFARRAYSIZE 16384L #else #define BITFARRAYSIZE 32768L #endif /* ** TYPEDEFS */ typedef struct { int adjust; /* Set adjust code */ unsigned long request_secs; /* # of seconds requested */ double bitopspersec; /* # of bitfield ops per sec */ unsigned long bitoparraysize; /* Total # of bitfield ops */ unsigned long bitfieldarraysize; /* Bit field array size */ } BitOpStruct; /**************************** ** EMULATED FLOATING POINT ** ****************************/ /* ** DEFINES */ #define INTERNAL_FPF_PRECISION 4 /* ** The following constant is the maximum number of loops ** of the emulated floating point test that the system ** will allow before flagging an error. This is not a ** critical constant, and can be altered if your system is ** a real barn-burner. */ /*#define CPUEMFLOATLOOPMAX 50000L*/ #define CPUEMFLOATLOOPMAX 500000L /* ** Set size of array */ #define EMFARRAYSIZE 3000L /* ** TYPEDEFS */ typedef struct { int adjust; /* Set adjust code */ unsigned long request_secs; /* # of seconds requested */ unsigned long arraysize; /* Size of array */ unsigned long loops; /* Loops per iterations */ double emflops; /* Results */ } EmFloatStruct; /************************* ** FOURIER COEFFICIENTS ** *************************/ /* ** TYPEDEFS */ typedef struct { int adjust; /* Set adjust code */ unsigned long request_secs; /* # of requested seconds */ unsigned long arraysize; /* Size of coeff. arrays */ double fflops; /* Results */ } FourierStruct; /************************* ** ASSIGNMENT ALGORITHM ** *************************/ /* ** TYPEDEFS */ typedef struct { int adjust; /* Set adjust code */ unsigned long request_secs; /* Requested # of seconds */ unsigned long numarrays; /* # of arrays */ double iterspersec; /* Results */ } AssignStruct; /******************** ** IDEA ENCRYPTION ** ********************/ /* ** DEFINES */ /* Following constant defines the max number of loops the ** system will attempt. Keeps things from going off into the ** weeds. */ /*#define MAXIDEALOOPS 50000L*/ #define MAXIDEALOOPS 500000L /* ** Following constant sets the size of the arrays. ** NOTE: For the IDEA algorithm to work properly, this ** number MUST be some multiple of 8. */ #define IDEAARRAYSIZE 4000L /* ** TYPEDEFS */ typedef struct { int adjust; /* Set adjust code */ unsigned long request_secs; /* Requested # of seconds */ unsigned long arraysize; /* Size of array */ unsigned long loops; /* # of times to convert */ double iterspersec; /* Results */ } IDEAStruct; /************************ ** HUFFMAN COMPRESSION ** ************************/ /* ** DEFINES */ /* ** MAXHUFFLOOPS ** ** This constant specifies the maximum number of Huffman ** compression loops the system will try for. This keeps ** the test from going off into the weeds. This is not ** a critical constant, and can be increased if your ** system is a real barn-burner. */ /*#define MAXHUFFLOOPS 50000L*/ #define MAXHUFFLOOPS 500000L /* ** Following constant sets the size of the arrays to ** be compressed/uncompressed. */ #define HUFFARRAYSIZE 5000L /* ** TYPEDEFS */ typedef struct { int adjust; /* Set adjust code */ unsigned long request_secs; /* Requested # of seconds */ unsigned long arraysize; /* Size of array */ unsigned long loops; /* # of times to compress/decompress */ double iterspersec; /* Results */ } HuffStruct; /******************************** ** BACK PROPAGATION NEURAL NET ** ********************************/ /* ** MAXNNETLOOPS ** ** This constant sets the max number of loops through the neural ** net that the system will attempt before giving up. This ** is not a critical constant. You can alter it if your system ** has sufficient horsepower. */ /*#define MAXNNETLOOPS 50000L*/ #define MAXNNETLOOPS 500000L /* ** TYPEDEFS */ typedef struct { int adjust; /* Set adjust code */ unsigned long request_secs; /* Requested # of seconds */ unsigned long loops; /* # of times to learn */ double iterspersec; /* Results */ } NNetStruct; /*********************** ** LU DECOMPOSITION ** ** (Linear Equations) ** ***********************/ /* ** MAXLUARRAYS ** ** This sets the upper limit on the number of arrays ** that the benchmark will attempt to build before ** flagging an error. It is not a critical constant, and ** may be increased if your system has the horsepower. */ /*#define MAXLUARRAYS 1000*/ #define MAXLUARRAYS 10000 /* ** TYPEDEFS */ typedef struct { int adjust; /* Set adjust code */ unsigned long request_secs; /* Requested # of seconds */ unsigned long numarrays; /* # of arrays */ double iterspersec; /* Results */ } LUStruct;