OpenPKG CVS Repository
  http://cvs.openpkg.org/
  ____________________________________________________________________________

  Server: cvs.openpkg.org                  Name:   Ralf S. Engelschall
  Root:   /e/openpkg/cvs                   Email:  [EMAIL PROTECTED]
  Module: openpkg-src                      Date:   22-Aug-2004 13:15:33
  Branch: HEAD                             Handle: 2004082212153200

  Added files:
    openpkg-src/whetstone   whetstone.patch

  Log:
    commit patch to CVS

  Summary:
    Revision    Changes     Path
    1.1         +55 -0      openpkg-src/whetstone/whetstone.patch
  ____________________________________________________________________________

  patch -p0 <<'@@ .'
  Index: openpkg-src/whetstone/whetstone.patch
  ============================================================================
  $ cvs diff -u -r0 -r1.1 whetstone.patch
  --- /dev/null 2004-08-22 13:15:32 +0200
  +++ whetstone.patch   2004-08-22 13:15:33 +0200
  @@ -0,0 +1,55 @@
  +Index: whetstone.c
  +--- whetstone.c.orig Sun Aug 30 10:03:47 1998
  ++++ whetstone.c      Sun Aug 30 10:06:00 1998
  +@@ -59,6 +59,12 @@
  + 
  + /* the following is optional depending on the timing function used */
  + #include <time.h>
  ++#ifdef CLOCKS_PER_SEC
  ++#define mytime() clock()
  ++#else
  ++#define mytime() time(0)
  ++#define CLOCKS_PER_SEC 1
  ++#endif
  + 
  + /* map the FORTRAN math functions, etc. to the C versions */
  + #define DSIN        sin
  +@@ -120,7 +126,7 @@
  + C   Start benchmark timing at this point.
  + C
  + */
  +-    startsec = time(0);
  ++    startsec = mytime();
  + 
  + /*
  + C
  +@@ -355,7 +361,7 @@
  + C      Stop benchmark timing at this point.
  + C
  + */
  +-    finisec = time(0);
  ++    finisec = mytime();
  + 
  + /*
  + C----------------------------------------------------------------
  +@@ -367,15 +373,16 @@
  + C--------------------------------------------------------------------
  + */
  +     printf("\n");
  +-    if (finisec-startsec <= 0) {
  ++    if (finisec-startsec <= 100) {
  +             printf("Insufficient duration- Increase the LOOP count\n");
  +             return(1);
  +     }
  + 
  +-    printf("Loops: %ld, Iterations: %d, Duration: %ld sec.\n",
  +-                    LOOP, II, finisec-startsec);
  ++    printf("Loops: %ld, Iterations: %d, Duration: %f sec.\n",
  ++                    LOOP, II,
  ++                    (float)(finisec-startsec)/(float)CLOCKS_PER_SEC);
  + 
  +-    KIPS = (100.0*LOOP*II)/(float)(finisec-startsec);
  ++    KIPS = (100.0*LOOP*II*CLOCKS_PER_SEC)/(float)(finisec-startsec);
  +     if (KIPS >= 1000.0)
  +             printf("C Converted Double Precision Whetstones: %.1f MIPS\n", 
KIPS/1000.0);
  +     else
  @@ .
______________________________________________________________________
The OpenPKG Project                                    www.openpkg.org
CVS Repository Commit List                     [EMAIL PROTECTED]

Reply via email to