• 2019 Update 4
  • 03/20/2019
  • Public Content
Contents

Vectorizer Knobs

Several environment variables are related to vectorizer. The first one is
CL_CONFIG_USE_VECTORIZER,
which can be set to False and True respectively. Notice that just like any other environment variables this one affects the behavior of the vectorizer of the entire system (or shell instances) until variable gets unset explicitly (or shell(s) terminates). This specific variable affects code generation for Intel® Xeon Phi™ coprocessor device as well.
Another variable is
CL_CONFIG_CPU_VECTORIZER_MODE
(that affects code generation for CPU OpenCL device only). It effectively sets the vectorization “width” (when
CL_CONFIG_USE_VECTORIZER = True
):
  • CL_CONFIG_CPU_VECTORIZER_MODE = 0
    (default). The compiler makes heuristic decisions whether to vectorize each kernel, and if so which vector width to use.
  • CL_CONFIG_CPU_VECTORIZER_MODE = 1
    . No vectorization by compiler. Explicit vector data types in kernels are left intact. This mode is the same as
    CL_CONFIG_USE_VECTORIZER = False
    .
  • CL_CONFIG_CPU_VECTORIZER_MODE = 4
    . Disables heuristic and vectorizes to the width of 4.
  • CL_CONFIG_CPU_VECTORIZER_MODE = 8
    . Disables heuristic and vectorizes to the width of 8.
Note
Some kernels cannot be vectorized, so the vectorizer does not handle them, regardless the mode. Also be careful with manual overriding the compiler heuristic, build process fails if the target hardware doesn't support the specific vectorization width. Inspect the compiler output in the offline compiler tool (described in the product User’s Guide) on the messages related to vectorization.

Product and Performance Information

1

Performance varies by use, configuration and other factors. Learn more at www.Intel.com/PerformanceIndex.