- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
/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.
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
/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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page