My question is simply how can I disable only the SIMD auto-vectorization optimization (keeping other optimizations of Release mode) in Visual Studio 2015 for:
1) the whole project being compiled;
2) for parts of the code.
In the first case, I would like to learn how to disable it for the whole project. For the second case, I would like to know whether it is also possible to do it for specific areas of the code, similarly to what is possible for all optimizations when using #pragma optimize("", off) and #pragma optimize("", on).
The purpose of this is performance comparison of some manually optimized code against the compiler's automatic SIMD vectorization.
The Visual C++ auto-vectorizer is automatically enabled when building with /O2 or /Ox.
To see what it is doing, build with /Qvec-report:1 or /Qvec-report:2.
You can disable it for specific loops by using #pragma loop(no_vector)
See MSDN
There's no documented way to disable the auto-vectorizer globally while keeping standard optimizations enabled.
For more information, see this blog series, this video, and the Auto-Vectorization Cookbook
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With