Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 Can you guys run a benchmark test for me?
Index -> General Discussion
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
matt271




PostPosted: Sun Mar 25, 2012 12:08 pm   Post subject: Can you guys run a benchmark test for me?

Hi guys

Can you guys run a benchmark for me? This is for a paper; similar to one I had asked for a year ago; but this one is optimized differently.

c:
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <time.h>

#define TESTS 10

float ofk_accumulator = 0.0;

float InvSqrt(float x) {
   float xhalf = 0.5f * x;
   int i = *(int*) &x;
   i = 0x5f3759df - (i >> 1);
   x = *(float*) &i;
   x = x * (1.5f - xhalf * x * x);
   return x;
}

double testInvSqrt() {
   time_t start = clock();
   int i;
   float f, g;
   for (i = 0x00800000; i < 0x7f800000; i++) {
       f = *(float *) &i;
       g = InvSqrt(f);
       ofk_accumulator += g;
   }
   return (double) (clock() - start) / CLOCKS_PER_SEC;
}

double testSqrtf() {
   time_t start = clock();
   int i;
   float f, g;
   for (i = 0x00800000; i < 0x7f800000; i++) {
       f = *(float *) &i;
       g = 1.0f / sqrtf(f);
       ofk_accumulator += g;
   }
   return (double) (clock() - start) / CLOCKS_PER_SEC;
}

int main(int argc, char** argv) {
   int i;
   float a, b, d, sum = 0.0F;
   
   FILE *f = fopen("benchmark.txt", "w");

   for (i = 0; i < TESTS; i++) {
       a = testInvSqrt();
       printf("%f", a);
       b = testSqrtf();
       printf("\t%f", b);
       d = b / a;
       printf("\t%f\n", d);
       sum += d;
       fprintf(f, "%f\t%f\t%f\n", a, b, d);
   }
   printf("%f\n", sum / TESTS);
   fprintf(f, "%f\n", sum / TESTS);

   fclose(f);
   
   // thanks kaser...
   if (ofk_accumulator > 3.0)
       printf(" ");
   else
       printf("   ");

   return (EXIT_SUCCESS);
}


Please compile with gcc -O3 -lm test.c or equivalent and post cpu details cat /proc/cpuinfo.

Thank you very much!

Last time, some people found it ran too long. If that is the case, just cancel it and post what it completed. Test only takes about 3 minutes on my Macbook Pro.

If you want to leave any name or other details, I can note you as a personal communication in my references.
Sponsor
Sponsor
Sponsor
sponsor
Sur_real




PostPosted: Sun Mar 25, 2012 3:52 pm   Post subject: Re: Can you guys run a benchmark test for me?

disclaimer: I ran this test on windows. My linux machine is a VM so I dunno if that would have been the best idea

Benchmark.txt
code:

4.805000        37.835999       7.874298
4.735000        37.823002       7.987962
4.740000        37.825001       7.979959
4.713000        37.792000       8.018672
4.693000        37.918999       8.079906
4.761000        37.932999       7.967443
4.715000        37.912998       8.040933
4.725000        37.876999       8.016296
4.725000        37.937000       8.028995
4.706000        37.869999       8.047174
8.004164


CPU:
code:

CPU Identification utility v2.09                 (c) 1997-2012 Jan Steunebrink
 ==============================================================================
 CPU Vendor and Model: Intel Core i7 Quad M i7-2600QM/2700QM series D2-step
 Internal CPU speed  : 1995.4 MHz
 System CPU count    : 1 Physical CPU(s), 4 Core(s) per CPU, 8 Thread(s)
 CPU-ID Vendor string: GenuineIntel
 CPU-ID Name string  : Intel(R) Core(TM) i7-2630QM CPU @ 2.00GHz
 CPU-ID Signature    : 0206A7
 CPU Features        : Floating-Point Unit on chip  : Yes
                       Time Stamp Counter           : Yes
                       Enhanced SpeedStep Technology: Yes
                       Hyper-Threading Technology   : Yes
                       Execute Disable protection   : Yes
                       64-bit support               : Yes
                       Virtualization Technology    : Yes
 Instr set extensions: MMX, SSE, SSE2, SSE3, SSSE3, SSE4.1, SSE4.2
 Size of L1 cache    : 4 x 64 KB
 Integrated L2 cache : 4 x 256 KB
 Integrated L3 cache : 6144 KB
matt271




PostPosted: Sun Mar 25, 2012 5:40 pm   Post subject: RE:Can you guys run a benchmark test for me?

Thanks!
crossley7




PostPosted: Sun Mar 25, 2012 9:10 pm   Post subject: RE:Can you guys run a benchmark test for me?

CPU Info:
code:


Intel(R) Processor Identification Utility
Version: 4.41.20111201
Time Stamp: 2012/03/26 01:57:33
Operating System: 6.1-7601-Service Pack 1
Number of processors in system: 1
Current processor: #1
Active cores per processor: 2
Disabled cores per processor: 0
Processor Name: Intel(R) Core(TM) i5-2410M CPU @ 2.30GHz
Type: 0
Family: 6
Model: 2A
Stepping: 7
Revision: 1A
Maximum CPUID Level: D
L1 Instruction Cache: 2 x 32 KB
L1 Data Cache: 2 x 32 KB
L2 Cache: 2 x 256 KB
L3 Cache: 3 MB
Packaging: LGA1155
Enhanced Intel SpeedStep(R) Technology: Yes
MMX(TM): Yes
Intel(R) SSE: Yes
Intel(R) SSE2: Yes
Intel(R) SSE3: Yes
Intel(R) SSE4: Yes
Intel(R) AES-NI: Yes
Intel(R) AVX: Yes
Enhanced Halt State: Yes
Execute Disable Bit: Yes
Intel(R) Hyper-Threading Technology: Yes
Intel(R) 64 Architecture: Yes
Intel(R) Virtualization Technology: Yes
System Graphics: Intel(R) HD Graphics 3000
Expected Processor Frequency: 2.30 GHz
Reported Processor Frequency: 2.69 GHz
Expected System Bus Frequency: 100 MHz
Reported System Bus Frequency: 100 MHz
*************************************************************


benchmark.txt:
code:

24.809999       36.719002      1.480008
26.749001       36.891998      1.379192
24.524000       36.707001      1.496779
25.052000       37.408001      1.493214
25.207001       36.953999      1.466021
24.780001       37.258999      1.503592
25.486000       37.292000      1.463235
25.969000       37.479000      1.443221
26.422001       37.837002      1.432026
25.191999       37.539001      1.490116
1.464740
Ultrahex




PostPosted: Sun Mar 25, 2012 10:17 pm   Post subject: Re: Can you guys run a benchmark test for me?

proc info:
code:
processor       : 0
vendor_id       : GenuineIntel
cpu family      : 6
model      : 42
model name      : Intel(R) Core(TM) i7-2640M CPU @ 2.80GHz
stepping        : 7
microcode       : 0x25
cpu MHz  : 2790.629
cache size      : 4096 KB
physical id     : 0
siblings        : 4
core id  : 0
cpu cores       : 2
apicid    : 0
initial apicid  : 0
fpu          : yes
fpu_exception   : yes
cpuid level     : 13
wp            : yes
flags      : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx rdtscp lm constant_tsc arch_perfmon pebs bts nopl xtopology nonstop_tsc aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 cx16 xtpr pdcm pcid sse4_1 sse4_2 x2apic popcnt tsc_deadline_timer aes xsave avx lahf_lm ida arat epb xsaveopt pln pts dts tpr_shadow vnmi flexpriority ept vpid
bogomips        : 5583.81
clflush size    : 64
cache_alignment : 64
address sizes   : 36 bits physical, 48 bits virtual
power management:

(there is 4 of these I don't care to repeat)


benchmark.txt
code:

5.860000        23.920000       4.081911
5.820000        23.900000       4.106529
5.810000        23.930000       4.118761
5.850000        23.889999       4.083761
5.850000        23.889999       4.083761
5.810000        23.889999       4.111876
5.810000        23.879999       4.110155
5.840000        23.900000       4.092465
5.810000        23.889999       4.111876
5.830000        23.889999       4.097770
4.099887
matt271




PostPosted: Mon Mar 26, 2012 4:27 pm   Post subject: RE:Can you guys run a benchmark test for me?

thank you guys!
Display posts from previous:   
   Index -> General Discussion
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 6 Posts ]
Jump to:   


Style:  
Search: