Vectorizer Knobs

Several environment variables and one attribute extension are related to vectorizer.

Environment Variables

CL_CONFIG_USE_VECTORIZER

This variable 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).

CL_CONFIG_CPU_VECTORIZER_MODE

This variable affects code generation for CPU OpenCL device only. It effectively sets the vectorization “width” (when CL_CONFIG_USE_VECTORIZER = True):

 

Attribute Extensions

cl_intel_vec_len_hint

The goal of this extension is to allow programmers to specify vector length the kernel should be vectorized to. This information may be used by the compiler to generate more optimal code.

For a device that supports the extension, the function clGetDeviceInfo with the parameter CL_DEVICE_EXTENSION returns a space separated list of extensions names that contains cl_intel_vec_len_hint.

Use the OpenCL C optional attribute qualifier  __attribute__((intel_vec_len_hint(<int>))), where <int> is a vector length that the kernel should be vectorized to.

You can set one the following value to the variable:

 

Note

If the work group size is not evenly divisible by the specified vector length hint, loop remainder might not be executed in vector code iterations.

Note

If you specify simultaneously the intel_vec_len_hint and vec_type_hint attributes, the compiler ignores vec_type_hint attribute.

The examples below illustrate valid and invalid uses of the extension:

See Also

Developer Guide for Intel® SDK for OpenCL™ Applications