Software Archive
Read-only legacy content
17061 Discussions

IEEE 754 Standard Compliance: CPU vs GPU or, a War between Intel and NVIDIA

SergeyKostrov
Valued Contributor II
2,293 Views
*** IEEE 754 Standard Compliance: CPU vs GPU or, a War between Intel and NVIDIA *** [ Abstract ] In 2011 NVIDIA published an article about compliance of Floating-Point arithmetic on GPUs and also compared it with Floating-Point arithmetic on CPUs. The article is very good but it has lots of errors, "crafted" test cases to demonstrate that CPUs have some issues and GPUs do not, and some technical information is obsolete. Even if the article was last updated in 2015 non of errors I've found are still Not fixed. My review of the article will be submitted later on.,
0 Kudos
51 Replies
SergeyKostrov
Valued Contributor II
289 Views
[ Intel C++ compiler v12.1.7 ( u371 ) 32-bit - Release ]

 ...
 CRT                   CrtSin(  45.00 ) =  0.7071067690849304200000      Completed in    0 ticks
 Normalized TS    msF.SinNTS7(  45.00 ) =  0.7071064710617065400000      Completed in    0 ticks
 Normalized TS    msF.SinNTS9(  45.00 ) =  0.7071068286895752000000      Completed in    0 ticks
 Normalized TS   msF.SinNTS11(  45.00 ) =  0.7071067690849304200000      Completed in    0 ticks
 TMathSet Sine Methods - RTfloat - Passed
 CRT                   CrtSin(  45.00 ) =  0.7071067811865474600000      Completed in    0 ticks
 Normalized TS    msD.SinNTS7(  45.00 ) =  0.7071064695751780900000      Completed in    0 ticks
 Normalized TS    msD.SinNTS9(  45.00 ) =  0.7071067829368671300000      Completed in    0 ticks
 Normalized TS   msD.SinNTS11(  45.00 ) =  0.7071067811796194500000      Completed in    0 ticks
 TMathSet Sine Methods - RTdouble - Passed
 CRT                   CrtCos(  45.00 ) =  0.7071067690849304200000      Completed in    0 ticks
 Normalized TS    msF.CosNTS7(  45.00 ) =  0.7071031928062439000000      Completed in    0 ticks
 Normalized TS    msF.CosNTS9(  45.00 ) =  0.7071068286895752000000      Completed in    0 ticks
 Normalized TS   msF.CosNTS11(  45.00 ) =  0.7071067094802856400000      Completed in    0 ticks
 TMathSet Cosine Methods - RTfloat - Passed
 CRT                   CrtCos(  45.00 ) =  0.7071067811865475700000      Completed in    0 ticks
 Normalized TS    msD.CosNTS7(  45.00 ) =  0.7071032148228456600000      Completed in    0 ticks
 Normalized TS    msD.CosNTS9(  45.00 ) =  0.7071068056832943100000      Completed in    0 ticks
 Normalized TS   msD.CosNTS11(  45.00 ) =  0.7071067810719247100000      Completed in    0 ticks
 TMathSet Cosine Methods - RTdouble - Passed
 CRT                   CrtTan(  45.00 ) =  1.0000000000000000000000      Completed in    0 ticks
 Normalized TS    msF.TanNTS7(  45.00 ) =  1.0000046491622925000000      Completed in    0 ticks
 Normalized TS    msF.TanNTS9(  45.00 ) =  1.0000000000000000000000      Completed in    0 ticks
 Normalized TS   msF.TanNTS11(  45.00 ) =  1.0000001192092896000000      Completed in    0 ticks
 TMathSet Tangent Methods - RTfloat - Passed
 CRT                   CrtTan(  45.00 ) =  0.9999999999999998900000      Completed in    0 ticks
 Normalized TS    msD.TanNTS7(  45.00 ) =  1.0000046029381060000000      Completed in    0 ticks
 Normalized TS    msD.TanNTS9(  45.00 ) =  0.9999999678316953100000      Completed in    0 ticks
 Normalized TS   msD.TanNTS11(  45.00 ) =  1.0000000001523033000000      Completed in    0 ticks
 TMathSet Tangent Methods - RTdouble - Passed
 ...

 

0 Kudos
SergeyKostrov
Valued Contributor II
289 Views
[ MinGW C++ compiler v5.1.0 32-bit - Release ]

 ...
 CRT                   CrtSin(  45.00 ) =  0.7071067690849304200000      Completed in    0 ticks
 Normalized TS    msF.SinNTS7(  45.00 ) =  0.7071064710617065400000      Completed in    0 ticks
 Normalized TS    msF.SinNTS9(  45.00 ) =  0.7071068286895752000000      Completed in    0 ticks
 Normalized TS   msF.SinNTS11(  45.00 ) =  0.7071067690849304200000      Completed in    0 ticks
 TMathSet Sine Methods - RTfloat - Passed
 CRT                   CrtSin(  45.00 ) =  0.7071067811865474600000      Completed in    0 ticks
 Normalized TS    msD.SinNTS7(  45.00 ) =  0.7071064695751780900000      Completed in    0 ticks
 Normalized TS    msD.SinNTS9(  45.00 ) =  0.7071067829368671300000      Completed in    0 ticks
 Normalized TS   msD.SinNTS11(  45.00 ) =  0.7071067811796194500000      Completed in    0 ticks
 TMathSet Sine Methods - RTdouble - Passed
 CRT                   CrtCos(  45.00 ) =  0.7071067690849304200000      Completed in    0 ticks
 Normalized TS    msF.CosNTS7(  45.00 ) =  0.7071031928062439000000      Completed in    0 ticks
 Normalized TS    msF.CosNTS9(  45.00 ) =  0.7071068286895752000000      Completed in    0 ticks
 Normalized TS   msF.CosNTS11(  45.00 ) =  0.7071067094802856400000      Completed in    0 ticks
 TMathSet Cosine Methods - RTfloat - Passed
 CRT                   CrtCos(  45.00 ) =  0.7071067811865475700000      Completed in    0 ticks
 Normalized TS    msD.CosNTS7(  45.00 ) =  0.7071032148228456600000      Completed in    0 ticks
 Normalized TS    msD.CosNTS9(  45.00 ) =  0.7071068056832943100000      Completed in    0 ticks
 Normalized TS   msD.CosNTS11(  45.00 ) =  0.7071067810719247100000      Completed in    0 ticks
 TMathSet Cosine Methods - RTdouble - Passed
 CRT                   CrtTan(  45.00 ) =  1.0000000000000000000000      Completed in    0 ticks
 Normalized TS    msF.TanNTS7(  45.00 ) =  1.0000046491622925000000      Completed in    0 ticks
 Normalized TS    msF.TanNTS9(  45.00 ) =  1.0000000000000000000000      Completed in    0 ticks
 Normalized TS   msF.TanNTS11(  45.00 ) =  1.0000001192092896000000      Completed in    0 ticks
 TMathSet Tangent Methods - RTfloat - Passed
 CRT                   CrtTan(  45.00 ) =  0.9999999999999998900000      Completed in    0 ticks
 Normalized TS    msD.TanNTS7(  45.00 ) =  1.0000046029381060000000      Completed in    0 ticks
 Normalized TS    msD.TanNTS9(  45.00 ) =  0.9999999678316953100000      Completed in    0 ticks
 Normalized TS   msD.TanNTS11(  45.00 ) =  1.0000000001523033000000      Completed in    0 ticks
 TMathSet Tangent Methods - RTdouble - Passed
 ...

 

0 Kudos
SergeyKostrov
Valued Contributor II
289 Views
[ Watcom C++ compiler v2.0.0 32-bit - Release ]

 ...
 CRT                   CrtSin(  45.00 ) =  0.7071067690849304199200      Completed in    0 ticks
 Normalized TS    msF.SinNTS7(  45.00 ) =  0.7071064710617065429600      Completed in    0 ticks
 Normalized TS    msF.SinNTS9(  45.00 ) =  0.7071067690849304199200      Completed in    0 ticks
 Normalized TS   msF.SinNTS11(  45.00 ) =  0.7071067690849304199200      Completed in    0 ticks
 TMathSet Sine Methods - RTfloat - Passed
 CRT                   CrtSin(  45.00 ) =  0.7071067811865474617100      Completed in    0 ticks
 Normalized TS    msD.SinNTS7(  45.00 ) =  0.7071064695751780870800      Completed in    0 ticks
 Normalized TS    msD.SinNTS9(  45.00 ) =  0.7071067829368671286900      Completed in    0 ticks
 Normalized TS   msD.SinNTS11(  45.00 ) =  0.7071067811796194479900      Completed in    0 ticks
 TMathSet Sine Methods - RTdouble - Passed
 CRT                   CrtCos(  45.00 ) =  0.7071067690849304199200      Completed in    0 ticks
 Normalized TS    msF.CosNTS7(  45.00 ) =  0.7071031928062438964800      Completed in    0 ticks
 Normalized TS    msF.CosNTS9(  45.00 ) =  0.7071067690849304199200      Completed in    0 ticks
 Normalized TS   msF.CosNTS11(  45.00 ) =  0.7071067690849304199200      Completed in    0 ticks
 TMathSet Cosine Methods - RTfloat - Passed
 CRT                   CrtCos(  45.00 ) =  0.7071067811865475727300      Completed in    0 ticks
 Normalized TS    msD.CosNTS7(  45.00 ) =  0.7071032148228456604100      Completed in    0 ticks
 Normalized TS    msD.CosNTS9(  45.00 ) =  0.7071068056832943149400      Completed in    0 ticks
 Normalized TS   msD.CosNTS11(  45.00 ) =  0.7071067810719247059800      Completed in    0 ticks
 TMathSet Cosine Methods - RTdouble - Passed
 CRT                   CrtTan(  45.00 ) =  1.0000000000000000000000      Completed in    0 ticks
 Normalized TS    msF.TanNTS7(  45.00 ) =  1.0000046491622924805000      Completed in    0 ticks
 Normalized TS    msF.TanNTS9(  45.00 ) =  1.0000000000000000000000      Completed in    0 ticks
 Normalized TS   msF.TanNTS11(  45.00 ) =  1.0000000000000000000000      Completed in    0 ticks
 TMathSet Tangent Methods - RTfloat - Passed
 CRT                   CrtTan(  45.00 ) =  0.9999999999999998889700      Completed in    0 ticks
 Normalized TS    msD.TanNTS7(  45.00 ) =  1.0000046029381060020000      Completed in    0 ticks
 Normalized TS    msD.TanNTS9(  45.00 ) =  0.9999999678316953133300      Completed in    0 ticks
 Normalized TS   msD.TanNTS11(  45.00 ) =  1.0000000001523032811000      Completed in    0 ticks
 TMathSet Tangent Methods - RTdouble - Passed
 ...

 

0 Kudos
SergeyKostrov
Valued Contributor II
289 Views
[ These are results of a very simple test that multiplies 0.1 by 0.1 ] Precisions: 24-bit, 53-bit and 64-bit are verified.
0 Kudos
SergeyKostrov
Valued Contributor II
289 Views
[ Microsoft C++ compiler ( VS2005 PE ) 32-bit - Release ] ... > CMathSet Methods < SetFpuControlData - RTfloat - Verification 24-bit : [ 0.1 * 0.1 = 0.01000000029802322600 ] 53-bit : [ 0.1 * 0.1 = 0.01000000029802322600 ] 64-bit : [ 0.1 * 0.1 = 0.01000000029802322600 ] Default : [ 0.1 * 0.1 = 0.01000000029802322600 ] SetFpuControlData - RTfloat - Passed SetFpuControlData - RTdouble - Verification 24-bit : [ 0.1 * 0.1 = 0.01000000000000000200 ] 53-bit : [ 0.1 * 0.1 = 0.01000000000000000200 ] 64-bit : [ 0.1 * 0.1 = 0.01000000000000000200 ] Default : [ 0.1 * 0.1 = 0.01000000000000000200 ] SetFpuControlData - RTdouble - Passed FPU Control Data - 24-bit Precision: [ Word = 0x20000 ][ Mask = 0x30000 ][ State = 655391 ] FPU Control Data - 53-bit Precision: [ Word = 0x10000 ][ Mask = 0x30000 ][ State = 589855 ] FPU Control Data - 64-bit Precision: [ Word = 0x00000 ][ Mask = 0x30000 ][ State = 524319 ] FPU Control Data - Default Precision: [ Word = 0x9001f ][ Mask = 0x30000 ][ State = 589855 ] GetFpuControlData - Passed ...
0 Kudos
SergeyKostrov
Valued Contributor II
289 Views
[ Borland C++ compiler v5.5.1 32-bit - Release ] ... > CMathSet Methods < SetFpuControlData - RTfloat - Verification 24-bit : [ 0.1 * 0.1 = 0.01000000121745702912 ] 53-bit : [ 0.1 * 0.1 = 0.01000000029802322560 ] 64-bit : [ 0.1 * 0.1 = 0.01000000029802322610 ] Default : [ 0.1 * 0.1 = 0.01000000029802322610 ] SetFpuControlData - RTfloat - Passed SetFpuControlData - RTdouble - Verification 24-bit : [ 0.1 * 0.1 = 0.00999999984306749440 ] 53-bit : [ 0.1 * 0.1 = 0.01000000000000000256 ] 64-bit : [ 0.1 * 0.1 = 0.01000000000000000194 ] Default : [ 0.1 * 0.1 = 0.01000000000000000194 ] SetFpuControlData - RTdouble - Passed FPU Control Data - 24-bit Precision: [ Word = 0x00000 ][ Mask = 0x00300 ][ State = 4210 ] FPU Control Data - 53-bit Precision: [ Word = 0x00200 ][ Mask = 0x00300 ][ State = 4722 ] FPU Control Data - 64-bit Precision: [ Word = 0x00300 ][ Mask = 0x00300 ][ State = 4978 ] FPU Control Data - Default Precision: [ Word = 0x00300 ][ Mask = 0x00300 ][ State = 4978 ] GetFpuControlData - Passed ...
0 Kudos
SergeyKostrov
Valued Contributor II
289 Views
[ Intel C++ compiler v12.1.7 ( u371 ) 32-bit - Release ] ... > CMathSet Methods < SetFpuControlData - RTfloat - Verification 24-bit : [ 0.1 * 0.1 = 0.01000000070780515700 ] 53-bit : [ 0.1 * 0.1 = 0.01000000070780515700 ] 64-bit : [ 0.1 * 0.1 = 0.01000000070780515700 ] Default : [ 0.1 * 0.1 = 0.01000000070780515700 ] SetFpuControlData - RTfloat - Passed SetFpuControlData - RTdouble - Verification 24-bit : [ 0.1 * 0.1 = 0.01000000000000000200 ] 53-bit : [ 0.1 * 0.1 = 0.01000000000000000200 ] 64-bit : [ 0.1 * 0.1 = 0.01000000000000000200 ] Default : [ 0.1 * 0.1 = 0.01000000000000000200 ] SetFpuControlData - RTdouble - Passed FPU Control Data - 24-bit Precision: [ Word = 0x20000 ][ Mask = 0x30000 ][ State = 17432607 ] FPU Control Data - 53-bit Precision: [ Word = 0x10000 ][ Mask = 0x30000 ][ State = 17367071 ] FPU Control Data - 64-bit Precision: [ Word = 0x00000 ][ Mask = 0x30000 ][ State = 17301535 ] FPU Control Data - Default Precision: [ Word = 0x9001f ][ Mask = 0x30000 ][ State = 17367071 ] GetFpuControlData - Passed ...
0 Kudos
SergeyKostrov
Valued Contributor II
289 Views
[ MinGW C++ compiler v5.1.0 32-bit - Release ] ... SetFpuControlData - RTfloat - Verification 24-bit : [ 0.1 * 0.1 = 0.01000000070780515700 ] 53-bit : [ 0.1 * 0.1 = 0.01000000070780515700 ] 64-bit : [ 0.1 * 0.1 = 0.01000000070780515700 ] Default : [ 0.1 * 0.1 = 0.01000000070780515700 ] SetFpuControlData - RTfloat - Passed SetFpuControlData - RTdouble - Verification 24-bit : [ 0.1 * 0.1 = 0.01000000000000000200 ] 53-bit : [ 0.1 * 0.1 = 0.01000000000000000200 ] 64-bit : [ 0.1 * 0.1 = 0.01000000000000000200 ] Default : [ 0.1 * 0.1 = 0.01000000000000000200 ] SetFpuControlData - RTdouble - Passed FPU Control Data - 24-bit Precision: [ Word = 0x20000 ][ Mask = 0x30000 ][ State = 655391 ] FPU Control Data - 53-bit Precision: [ Word = 0x10000 ][ Mask = 0x30000 ][ State = 589855 ] FPU Control Data - 64-bit Precision: [ Word = 0x00000 ][ Mask = 0x30000 ][ State = 524319 ] FPU Control Data - Default Precision: [ Word = 0x9001f ][ Mask = 0x30000 ][ State = 589855 ] GetFpuControlData - Passed ...
0 Kudos
SergeyKostrov
Valued Contributor II
289 Views
[ Watcom C++ compiler v2.0.0 32-bit - Release ] ... > CMathSet Methods < SetFpuControlData - RTfloat - Verification 24-bit : [ 0.1 * 0.1 = 0.01000000070780515671 ] 53-bit : [ 0.1 * 0.1 = 0.01000000029802322610 ] 64-bit : [ 0.1 * 0.1 = 0.01000000029802322610 ] Default : [ 0.1 * 0.1 = 0.01000000029802322610 ] SetFpuControlData - RTfloat - Passed SetFpuControlData - RTdouble - Verification 24-bit : [ 0.1 * 0.1 = 0.00999999977648258209 ] 53-bit : [ 0.1 * 0.1 = 0.01000000000000000194 ] 64-bit : [ 0.1 * 0.1 = 0.01000000000000000194 ] Default : [ 0.1 * 0.1 = 0.01000000000000000194 ] SetFpuControlData - RTdouble - Passed FPU Control Data - 24-bit Precision: [ Word = 0x00000 ][ Mask = 0x00300 ][ State = 4223 ] FPU Control Data - 53-bit Precision: [ Word = 0x00200 ][ Mask = 0x00300 ][ State = 4735 ] FPU Control Data - 64-bit Precision: [ Word = 0x00300 ][ Mask = 0x00300 ][ State = 4991 ] FPU Control Data - Default Precision: [ Word = 0x0123f ][ Mask = 0x00300 ][ State = 4735 ] GetFpuControlData - Passed ...
0 Kudos
SergeyKostrov
Valued Contributor II
289 Views
[ An issues with a PI number declaration in cl_platform.h header file ] NVIDIA has an issue with a PI number declaration in cl_platform.h header file: [ cl_platform.h ] ... #define CL_M_PI 3.141592653589793115998 ... Instead of: 3.1415926535897931159980000000000000000000 it is better to declare as: 3.1415926535897930000000000000000000000000 Here is PI number with 40 digits after the point: 3.1415926535897932384626433832795028841972
0 Kudos
Reply