Intel® Integrated Performance Primitives
Deliberate problems developing high-performance vision, signal, security, and storage applications.
6709 Discussions

Different rounding results of ippiDiv_32f_C1R under different hardware

Mikhail_Matrosov
487 Views
I have code yielding different results under different CPUs. Code is using ippiDiv_32f_C1R function. Here are the shortened version:

Ipp32f a = 12750.0f;
Ipp32f b = 204.0f;
Ipp32f c;
ippiDiv_32f_C1R(&b, step, &a, step, &c, step, size);

printf("ippiDiv(b, a) = %f\\n", c);
printf("a / b = %f\\n", a / b);

This code was compiled using Visual Studio 2010 SP1 and IPP 7.0.205. Then it was executed under three different computers all with the same Windows 7 x64 and different Intel Core2 CPUs: E6550, E7500 and Q9400.

Second printf always results in the same "a / b = 62.500000".

But results of the first (ippiDiv) printf differs on different computers. It yields "62.500000" under E6550 and "62.499996" under E7500 and Q9400.

This behaivor is the same under Debug and Release builds.

Floating point registers after calling ippiDiv are the same on all computers (CTRL=027F, STAT=0000).

Full code and test executable are attached.

Well, the questing is, is this behavior normal or a bug? I expect the same executable to perform exactly the same given the same data, even concerning rounding errors.
0 Kudos
1 Solution
Vladimir_Dudnik
Employee
487 Views
Hello,

Because of cpu-specific optimization we do not guarantee bit-exact results on different hardware. Instead, we do guarantee that the difference will not exceed 1 ULP.

Regards,
Vladimir

View solution in original post

0 Kudos
4 Replies
Vladimir_Dudnik
Employee
487 Views
Hello,

IPP contain cpu-specific implementation of functions, what means the same ippiDiv_32f_C1R function may run into different execution path depending on your target cpu. Thanks for informing us about that difference in results, we will check the root cause and come back to inform you. Although, most probablyit is difference between implementation the algorithm with using x87 FPU instructions and SIMD instructions.

Regards,
Vladimir
0 Kudos
Ivan_Z_Intel
Employee
487 Views

Hi!
Vladimir is right. Implementations of IPP-functions can be different for different CPU. This is the reason of the existence of insignificant error of calculations. In any event this error is no more 1 Ulp (for float data the relative error is less than 1.e-6).

0 Kudos
Mikhail_Matrosov
487 Views
Thanks for informing us about that difference in results, we will check the root cause and come back to inform you.

Are there any news on the issue? Can I expect this behavior to be fixed in the upcoming releases?
0 Kudos
Vladimir_Dudnik
Employee
488 Views
Hello,

Because of cpu-specific optimization we do not guarantee bit-exact results on different hardware. Instead, we do guarantee that the difference will not exceed 1 ULP.

Regards,
Vladimir
0 Kudos
Reply