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

Visual Studio IDE / Disable vectorization

emmanuel_attia
Beginner
1,152 Views

Hello,

I wonder why there is no option in the Visual Studio integration to disable automatic vectorization ? (I know i can put the flag manually but it make a little bit tedious transition between Microsoft and Intel toolset).

Best regards

0 Kudos
6 Replies
TimP
Honored Contributor III
1,152 Views

As far as I know, the options ICL uses to control vectorization are similar to those in CL, even though ICL is more aggressive.  You could set options such as /Qvec- in the additional command line, or set /O1, or /fp:source to cut out some optimizations which CL never undertakes.  ICL /fp:source is roughly equivalent to CL /fp:fast, and CL defaults to /fp:precise while ICL defaults to its more aggressive /fp:fast.

0 Kudos
emmanuel_attia
Beginner
1,152 Views

/Qvec- is Intel specific

/fp impacts much more than vectorization (i didn't even know it was related to automatic vectorization, i'm not talking about using SSE instruction in a scalar manner instead of FPU).

0 Kudos
TimP
Honored Contributor III
1,152 Views

/Qvec- is documented in my copy of Microsoft C++ (not even a current one).  No doubt, it was copied over from Intel just a few years ago.  In my tests, CL does vectorize about 40% of the cases which ICL can vectorize effectively at the most aggressive settings.  If your question was about not enabling optimizations which weren't performed by some past version of CL, neither Microsoft nor Intel has additional specific options that I know of. 

ICL has /Qvc options for compatibility with specific versions of Visual Studio, but they don't control vectorization.  They used to be set as defaults at the time you install with integration into the corresponding VS.

If you use OpenMP, in my experience CL never vectorizes inside a parallel region, but I wasn't guessing you were talking about that.  ICL would still vectorize for loops properly nested inside a parallel for.

/fp: options other than fast prevent vectorization which depends on optimizing order of operations and may cause small numerical differences (usually improved accuracy).  Microsoft doesn't perform such optimizations even at /fp:fast.  ICL /fp:fast throws out the rules about order of evaluation, including observance of parentheses, replacing them with K&R style rules from prior to C89.

By FPU, you may mean the use of x87 instructions, which by default have effect similar to /fp:double.  With either CL or ICL, you would require that option to minimize differences between what ICL calls /arch:IA32 (Microsoft 32-bit default) and the SSE modes.  This option also would reduce the differences between CL and ICL, including those related to vectorization.

0 Kudos
emmanuel_attia
Beginner
1,152 Views

Can I have the link on MSDN avout /Qvec- flag because I can't find it (i use 2008 and 2010 and 2012).

Microsoft (R) C/C++ Optimizing Compiler Version 17.00.60610.1 for x64
Copyright (C) Microsoft Corporation.  All rights reserved.

cl : Command line warning D9002 : ignoring unknown option '/Qvec-'
cl : Command line error D8003 : missing source filename

Microsoft (R) C/C++ Optimizing Compiler Version 16.00.40219.01 for x64
Copyright (C) Microsoft Corporation.  All rights reserved.

cl : Command line warning D9002 : ignoring unknown option '/Qvec-'
cl : Command line error D8003 : missing source filename

That does'nt explain why in the Intel C++ property sheet or the Visual Studio Integration component, there is no way to disable /Qvec- which seems to me a pretty much Intel specific compiler option (at least for people like me using prehistorical versions of Visual Studio).

0 Kudos
JenniferJ
Moderator
1,152 Views

Although you can always add any additional options to the "Additional command line options" in the project property, it might be better to add the "/Qvec-" to the "Diagnostics" property page. I'll file a feature request for it.

I didn't see "cl" support this option "/Qvec-" as well. "cl" does support /Qvec-report.

Jennifer

0 Kudos
emmanuel_attia
Beginner
1,152 Views

Thank you very much Jennifer, maybe it should be in Optimization or Code Generation, but it's your team choice. ;)

Emmanuel

0 Kudos
Reply