Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
Announcements
Welcome to the Intel Community. If you get an answer you like, please mark it as an Accepted Solution to help others. Thank you!

/fast option Visual Studio

Alessandro_D_
New Contributor I
285 Views

Dear users,

I would like to set the option /fast in order to speed up my code in Visual Studio Fortran (I have 2020 update 2 edition with VS 2019). I can easily do this if I compile my program from the command line, but how to add /fast in Visual Studio? I found only /O2 and /O3 in the menu Fortran>Optimization. Reading the manual, /fast does more aggressive optimizations than /O3 alone

Best,

Alessandro

 

0 Kudos
1 Solution
Steve_Lionel
Black Belt Retired Employee
273 Views

/fast turns on /O3 plus /Qipo, /Qprec-div-, /fp:fast=2, and /QxHost. There is not a separate property for it in VS, but you can use the Command Line > Additional Options property and type it in. Be aware that it can cause floating point results to vary a bit, especially with /fp:fast=2. /QxHost will mean that you shouldn't run the program on a CPU other than the one where it was compiled.

View solution in original post

4 Replies
Steve_Lionel
Black Belt Retired Employee
274 Views

/fast turns on /O3 plus /Qipo, /Qprec-div-, /fp:fast=2, and /QxHost. There is not a separate property for it in VS, but you can use the Command Line > Additional Options property and type it in. Be aware that it can cause floating point results to vary a bit, especially with /fp:fast=2. /QxHost will mean that you shouldn't run the program on a CPU other than the one where it was compiled.

View solution in original post

Ron_Green
Moderator
262 Views

I'm not a fan of /fast.  I liken it to a sausage - it is full of things that are not obvious, many of which are probably unhealthy for you.  Steve is correct in mentioning fp-model:fast=2 which in my opinion is overly aggressive for many applications.

Factually, the definition of /fast can and does change over time.  It has a number of options that give best benchmark results for the current "new" Intel processors.

But yes, it is fast.

Steve_Lionel
Black Belt Retired Employee
237 Views
Alessandro_D_
New Contributor I
211 Views

Thank you guys for your quick answers! I think that for my program the best trade-off between speed and accuracy is using only /O3 plus /Qipo, /Qprec-div- and /QxHost. I agree that fp-model:fast=2 is not very safe

 

 

Reply