/vlen (original) (raw)

Specifies the vector length for code generation on x86 and x64. For more information about /arch for x86 and x64, see /arch (x86) and /arch (x64).

Syntax

/vlen=[256|**512**]

/vlen

Arguments

/vlen=256
Specify a vector length of 256 bits for autovectorization and other optimizations.

/vlen=512
Specify a vector length of 512 bits for autovectorization and other optimizations.

/vlen
Specify the default vector length for the selected /arch setting.

Remarks

This compiler option was introduced in Visual Studio 2022 17.13.

If a specific /vlen value isn't specified, the default vector length depends on the /arch compiler option setting. The /vlen compiler option can override the default vector length specified by /arch:AVX512, /arch:AVX10.1, or /arch:AVX10.2 compiler option. For example:

When the specified /vlen value is incompatible with specified /arch compiler option, a warning is generated and default vector length for the /arch setting is used. For example:

To set the /vlen=256 or /vlen=512 compiler option in Visual Studio

  1. Open the Property Pages dialog box for the project. For more information, see Set C++ compiler and build properties in Visual Studio.
  2. Select the Configuration Properties > C/C++ > Command Line property page.
  3. In the Additional options box, add /vlen=256 or /vlen=512. Choose OK to save your changes.

See also

/arch (Minimum CPU Architecture)
MSVC compiler options
MSVC compiler command-line syntax