Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
New Contributor I
139 Views

/fast option Visual Studio

Jump to solution

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

Accepted Solutions
Highlighted
Black Belt Retired Employee
127 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
Highlighted
Black Belt Retired Employee
128 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

Highlighted
Moderator
116 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.

0 Kudos
Highlighted
Black Belt Retired Employee
91 Views

I agree with Ron.

0 Kudos
Highlighted
New Contributor I
65 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

 

 

0 Kudos