From 2b352223b3939e48342fc545ef4a55a97d58cf79 Mon Sep 17 00:00:00 2001 From: Matt Turner Date: Fri, 14 Nov 2008 21:40:55 +0000 Subject: -- Remove more useless stuff -- Begin cleaning up structs with consistent naming git-svn-id: svn://mattst88.com/svn/cleanbench/trunk@39 0d43b9a7-5ab2-4d7b-af9d-f64450cef757 --- assignment.c | 2 +- bitfield.c | 2 +- cleanbench.c | 22 +++++++++++----------- cleanbench.h | 1 - fourier.c | 2 +- fpemulation.c | 2 +- hardware.c | 2 +- hardware.h | 2 +- huffman.c | 2 +- idea.c | 2 +- linear.c | 2 +- neural.c | 2 +- nmglobal.h | 18 +++++++++--------- numsort.c | 2 +- stringsort.c | 12 ++---------- 15 files changed, 33 insertions(+), 42 deletions(-) diff --git a/assignment.c b/assignment.c index a083c32..2f0956c 100644 --- a/assignment.c +++ b/assignment.c @@ -121,7 +121,7 @@ DoAssign(void) free(arraybase); - locassignstruct->iterspersec = (double)(iterations * CLOCKS_PER_SEC *locassignstruct->numarrays) / (double)total_time; + locassignstruct->results = (double)(iterations * CLOCKS_PER_SEC *locassignstruct->numarrays) / (double)total_time; } diff --git a/bitfield.c b/bitfield.c index d04cb72..076ac0f 100644 --- a/bitfield.c +++ b/bitfield.c @@ -116,7 +116,7 @@ DoBitops(void) free(bitarraybase); free(bitoparraybase); - locbitopstruct->bitopspersec = (double)(iterations * CLOCKS_PER_SEC) / (double)total_time; + locbitopstruct->results = (double)(iterations * CLOCKS_PER_SEC) / (double)total_time; } /************************ diff --git a/cleanbench.c b/cleanbench.c index a1f1c53..b4f8ef2 100644 --- a/cleanbench.c +++ b/cleanbench.c @@ -160,7 +160,7 @@ for(i=0;ifflops = (double)(iterations * CLOCKS_PER_SEC) / (double)total_time; + locfourierstruct->results = (double)(iterations * CLOCKS_PER_SEC) / (double)total_time; } /************************ diff --git a/fpemulation.c b/fpemulation.c index cac88ee..755dc32 100644 --- a/fpemulation.c +++ b/fpemulation.c @@ -106,7 +106,7 @@ DoEmFloat(void) free(bbase); free(cbase); - locemfloatstruct->emflops = (double)(iterations * locemfloatstruct->loops * CLOCKS_PER_SEC) / (double)total_time; + locemfloatstruct->results = (double)(iterations * locemfloatstruct->loops * CLOCKS_PER_SEC) / (double)total_time; } /*********************** diff --git a/hardware.c b/hardware.c index 7823b4a..d2f32f6 100644 --- a/hardware.c +++ b/hardware.c @@ -145,7 +145,7 @@ static void readProcCpuInfo (char *model, char *cache) { ** Reads /proc/cpuinfo if on a linux system ** Writes output */ -void hardware(FILE *global_ofile) { +void hardware(void) { char os[BUF_SIZ]; char model[BUF_SIZ]; char cache[BUF_SIZ]; diff --git a/hardware.h b/hardware.h index b9085bc..5fe6c38 100644 --- a/hardware.h +++ b/hardware.h @@ -1,2 +1,2 @@ extern -void hardware(FILE *global_ofile); +void hardware(void); diff --git a/huffman.c b/huffman.c index e48483e..1e0dac9 100644 --- a/huffman.c +++ b/huffman.c @@ -151,7 +151,7 @@ DoHuffman(void) free(decomparray); free(hufftree); - lochuffstruct->iterspersec = (double)(iterations * CLOCKS_PER_SEC) / (double)total_time; + lochuffstruct->results = (double)(iterations * CLOCKS_PER_SEC) / (double)total_time; } /********************* diff --git a/idea.c b/idea.c index 9b1661b..28e6cc4 100644 --- a/idea.c +++ b/idea.c @@ -156,7 +156,7 @@ DoIDEA(void) free(crypt1); free(plain2); - locideastruct->iterspersec = (double)(iterations * CLOCKS_PER_SEC) / (double)total_time; + locideastruct->results = (double)(iterations * CLOCKS_PER_SEC) / (double)total_time; } /******************** diff --git a/linear.c b/linear.c index 030fe3b..0feef48 100644 --- a/linear.c +++ b/linear.c @@ -184,7 +184,7 @@ DoLU(void) free(bbase); free(LUtempvv); - loclustruct->iterspersec = (double)(iterations * CLOCKS_PER_SEC) / (double)total_time; + loclustruct->results = (double)(iterations * CLOCKS_PER_SEC) / (double)total_time; } /****************** diff --git a/neural.c b/neural.c index 6cd3c89..7f03545 100644 --- a/neural.c +++ b/neural.c @@ -165,7 +165,7 @@ DoNNET(void) iterations += locnnetstruct->loops; } while (total_time < locnnetstruct->request_secs * CLOCKS_PER_SEC); - locnnetstruct->iterspersec = (double)(iterations * CLOCKS_PER_SEC) / total_time; + locnnetstruct->results = (double)(iterations * CLOCKS_PER_SEC) / total_time; } /******************** diff --git a/nmglobal.h b/nmglobal.h index 9a25ac6..038d8c9 100644 --- a/nmglobal.h +++ b/nmglobal.h @@ -103,7 +103,7 @@ typedef struct { int adjust; /* Set adjust code */ unsigned long request_secs; /* # of seconds requested */ - double sortspersec; /* # of sort iterations per sec */ + double results; /* # of sort iterations per sec */ unsigned short numarrays; /* # of arrays */ unsigned long arraysize; /* # of elements in array */ } SortStruct; @@ -151,7 +151,7 @@ typedef struct { typedef struct { int adjust; /* Set adjust code */ unsigned long request_secs; /* # of seconds requested */ - double bitopspersec; /* # of bitfield ops per sec */ + double results; /* # of bitfield ops per sec */ unsigned long bitoparraysize; /* Total # of bitfield ops */ unsigned long bitfieldarraysize; /* Bit field array size */ } BitOpStruct; @@ -187,7 +187,7 @@ typedef struct { unsigned long request_secs; /* # of seconds requested */ unsigned long arraysize; /* Size of array */ unsigned long loops; /* Loops per iterations */ - double emflops; /* Results */ + double results; /* Results */ } EmFloatStruct; /************************* @@ -201,7 +201,7 @@ typedef struct { int adjust; /* Set adjust code */ unsigned long request_secs; /* # of requested seconds */ unsigned long arraysize; /* Size of coeff. arrays */ - double fflops; /* Results */ + double results; /* Results */ } FourierStruct; /************************* @@ -215,7 +215,7 @@ typedef struct { int adjust; /* Set adjust code */ unsigned long request_secs; /* Requested # of seconds */ unsigned long numarrays; /* # of arrays */ - double iterspersec; /* Results */ + double results; /* Results */ } AssignStruct; /******************** @@ -246,7 +246,7 @@ typedef struct { unsigned long request_secs; /* Requested # of seconds */ unsigned long arraysize; /* Size of array */ unsigned long loops; /* # of times to convert */ - double iterspersec; /* Results */ + double results; /* Results */ } IDEAStruct; @@ -284,7 +284,7 @@ typedef struct { unsigned long request_secs; /* Requested # of seconds */ unsigned long arraysize; /* Size of array */ unsigned long loops; /* # of times to compress/decompress */ - double iterspersec; /* Results */ + double results; /* Results */ } HuffStruct; /******************************** @@ -309,7 +309,7 @@ typedef struct { int adjust; /* Set adjust code */ unsigned long request_secs; /* Requested # of seconds */ unsigned long loops; /* # of times to learn */ - double iterspersec; /* Results */ + double results; /* Results */ } NNetStruct; /*********************** @@ -335,7 +335,7 @@ typedef struct { int adjust; /* Set adjust code */ unsigned long request_secs; /* Requested # of seconds */ unsigned long numarrays; /* # of arrays */ - double iterspersec; /* Results */ + double results; /* Results */ } LUStruct; extern unsigned long global_min_ticks; diff --git a/numsort.c b/numsort.c index f210388..c9e7f46 100644 --- a/numsort.c +++ b/numsort.c @@ -91,7 +91,7 @@ DoNumSort (void) free(arraybase); - numsortstruct->sortspersec = (double)(iterations * numsortstruct->numarrays * CLOCKS_PER_SEC) / (double)total_time; + numsortstruct->results = (double)(iterations * numsortstruct->numarrays * CLOCKS_PER_SEC) / (double)total_time; } /*********************** diff --git a/stringsort.c b/stringsort.c index 4cb9a45..f6d214b 100644 --- a/stringsort.c +++ b/stringsort.c @@ -44,12 +44,7 @@ static void strsift(unsigned long *optrarray, /***************** ** DoStringSort ** -****************** -** This routine performs the CPU string sort test. -** Arguments: -** requested_secs = # of seconds to execute test -** stringspersec = # of strings per second sorted (RETURNED) -*/ +*****************/ void DoStringSort(void) { const char* context = "CPU:String Sort"; @@ -58,9 +53,6 @@ void DoStringSort(void) clock_t total_time = 0; int iterations = 0; - /* - ** See if we have to perform self-adjustment code - */ if (strsortstruct->adjust == FALSE) { strsortstruct->adjust = TRUE; /* @@ -110,7 +102,7 @@ void DoStringSort(void) free(arraybase); - strsortstruct->sortspersec = (double)(iterations * CLOCKS_PER_SEC) / (double)total_time; + strsortstruct->results = (double)(iterations * CLOCKS_PER_SEC) / (double)total_time; } /************************** -- cgit v1.2.3