Intel® C++ Compiler
Community support and assistance for creating C++ code that runs on platforms based on Intel® processors.

O2 optimization

esrujan
Beginner
295 Views
Hi,

We have used O2 optimization of Intel C compiler version 10.0.1 for compilation of one of our application which is computationally intensive to be run over a IA 32 Linux machine. Though we could observe significant reduction in the time taken by the compiled code, a lot of floating point values that are given as output do not match with the outputs without using any optimization.

We suspect that the O2 optimization has caused some approximation resulting in loosing the accuracy of the application.

Can any one kindly throw us light on to the issue. Is it possible for us to use O2 optimization and still be able to fine tune the application such that we don't loose accuracy.

0 Kudos
2 Replies
TimP
Honored Contributor III
295 Views
Add the option -fp-model precise If you use SSE options, and depend on double evaluation of float expressions, there is fp-model double , but explicit casts would be better for that purpose.
If you don't use SSE, mixed float and double expressions can be greatly speeded up by the shortcuts which the optimization takes when you don't use -fp-model precise, but the compiler will ignore many (float) casts.
0 Kudos
Dale_S_Intel
Employee
295 Views
In fact, you may want to look over the documentation for -fp-model to determine which setting is most appropriate for your app.

Dale
0 Kudos
Reply