Intel® oneAPI DPC++/C++ Compiler

Developer Guide and Reference

ID 767253
Date 3/31/2025
Public
Document Table of Contents

Supported Environment Variables

Compiler Compile-Time Environment Variables

The following table shows the compile-time environment variables that affect the compiler:

Compile-Time Environment Variable

Description

CL (Windows)

_CL_ (Windows)

Define the files and options you use most often with the CL variable.

NOTE:
You cannot set the CL environment variable to a string that contains an equal sign. You can use the pound sign instead. In the following example, the pound sign (#) is used as a substitute for an equal sign in the assigned string: SET CL=/Dtest#100

ICXCFG

Specifies the configuration file for customizing compilations when invoking the compiler using icx. Used instead of the default configuration file.

ICPXCFG

Specifies the configuration file for customizing compilations when invoking the compiler using icpx. Used instead of the default configuration file.

__INTEL_PRE_CFLAGS

__INTEL_POST_CFLAGS

Specifies a set of compiler options to add to the compile line.

This is an extension to the facility already provided in the compiler configuration file icx.cfg.

You can insert command line options in the prefix position using __INTEL_PRE_CFLAGS , or in the suffix position using __INTEL_POST_CFLAGS . The command line syntax is: icx <PRE flags> <flags from configuration file> <flags from the compiler invocation> <POST flags>

NOTE:
By default, a configuration file named icx.cfg (Linux, Windows), or icpx.cfg (Linux) is used. This file is in the same directory as the compiler executable. To use another configuration file in another location, you can use the ICXCFG (Linux, Windows), ICPXCFG (Linux) environment variable to assign the directory and file name for the configuration file.
NOTE:
The driver issues a warning that the compiler is overriding an option because of an environment variable, but only when you include the option -w3 (Linux) or /W5 (Windows).

PATH

Specifies the directories the system searches for binary executable files.

NOTE:
On Windows, this also affects the search for Dynamic Link Libraries (DLLs).

Compiler Runtime Environment Variables

The following table summarizes compiler environment variables that are recognized at runtime.

Environment Variable

Default Value

Description

CL_CONFIG_CPU_EXPENSIVE_MEM_OPT

0

A bitmap indicating enabled expensive memory optimizations. These optimizations may lead to more just-in-time (JIT) compilation time, but give some performance benefit.

NOTE:
Currently, only the least significant bit is available.

Available bits:

  • 0: OpenCL™ address space alias analysis
CL_CONFIG_CPU_FORCE_LOCAL_MEM_SIZE

32KB

Forces CL_DEVICE_LOCAL_MEM_SIZE for CPU device to be the given value. The value needs to be set with size including units, examples: 8MB, 8192KB, 8388608B.

NOTE:
You must compile your host application with sufficient stack size. Our recommendation is to set the stack size equal to twice the local memory size to cover possible application and OpenCL™ Runtime overheads.
CL_CONFIG_CPU_FORCE_PRIVATE_MEM_SIZE

32KB

Forces CL_DEVICE_PRIVATE_MEM_SIZE for the CPU device to be the given value. The value must include the unit; for example: 8MB, 8192KB, 8388608B.

NOTE:
You must compile your host application with sufficient stack size.
CL_CONFIG_CPU_STREAMING_ALWAYS

False

Controls whether non-temporal instructions are used.

DPCPP_CPU_CU_AFFINITY

Not set

Set thread affinity to CPU. The value and meaning is the following:

  • close - threads are pinned to CPU cores successively through available cores.
  • spread - threads are spread to available cores.
  • master - threads are put in the same cores as master. If DPCPP_CPU_CU_AFFINITY is set, master thread is pinned as well, otherwise master thread is not pinned

This environment variable is similar to the OMP_PROC_BIND variable used by OpenMP.

NOTE:
Any(*) indicates that this environment variable is effective when set to any non-null value.

NOTE:

Some environment variables are available for both Intel® microprocessors and non-Intel microprocessors, but may perform additional optimizations for Intel® microprocessors than for non-Intel microprocessors.