Additional Predefined Macros

The compiler supports the predefined macros listed in the table below. The compiler also includes predefined macros specified by the ISO/ANSI standard.

Unless otherwise stated, the macros are supported on systems based on IA-32 (for C++ only) and Intel® 64 architectures.

Macro Description

__AVX__

On Linux*, defined as '1' when option -march=corei7-avx, or higher processor targeting options are specified.

Note

Available only for compilations targeting Intel® 64 architecture.

__AVX2__

( Linux)

On Linux, defined as '1' when option -march=core-avx2, or higher processor targeting options are specified.

Note

Available only for compilations targeting Intel® 64 architecture.

__AVX512BW__

(Windows*, Linux)

Defined as '1' for processors that support Intel® Advanced Vector Extensions 512 (Intel® AVX-512) Byte and Word Instructions (BWI).

__AVX512CD__

(Windows*, Linux)

Defined as '1' for processors that support Intel® Advanced Vector Extensions 512 (Intel® AVX-512) Conflict Detection Instructions (CDI).

__AVX512DQ__

(Windows*, Linux)

Defined as '1' for processors that support Intel® Advanced Vector Extensions 512 (Intel® AVX-512) Doubleword and Quadword Instructions (DQI).

__AVX512ER__

(Windows*, Linux)

Defined as '1' for processors that support Intel® Advanced Vector Extensions 512 (Intel® AVX-512) Exponential and Reciprocal Instructions.

__AVX512F__

(Windows*, Linux)

Defined as '1' for processors that support Intel® Advanced Vector Extensions 512 (Intel® AVX-512) Foundation instructions.

__AVX512PF__

(Windows*, Linux)

Defined as '1' for processors that support Intel® Advanced Vector Extensions 512 (Intel® AVX-512) Pre Fetch Instructions (PFI).

__AVX512VL__

(Windows*, Linux)

Defined as '1' for processors that support Intel® Advanced Vector Extensions 512 (Intel® AVX-512) Vector Length Extensions.

__BASE_FILE__

(Linux)

Name of source file

__COUNTER__

(Windows)

Defined as '0'.

__cplusplus

(Linux)

Defined as '1' (for the Intel® oneAPI DPC++/C++ Compiler).

__ELF__

(Linux)

Defined as '1' at the start of compilation.

__EXCEPTIONS

(Linux)

Defined as '1' when option fno-exceptions is not used.

__gnu_linux__

(Linux)

Defined as '1' at the start of compilation.

__GNUC__

(Linux)

The major version number of GCC installed on the system.

__GNUC_MINOR__

(Linux)

The minor version number of GCC or g++* installed on the system.

__GNUC_PATCHLEVEL__

(Linux)

The patch level version number of GCC or G++ installed on the system.

__GNUG__

(Linux)

The major version number of G++ installed on the system.

__i386__

__i386

i386

(Linux)

Defined as '1' for compilations targeting IA-32 architecture (C++ only).

_INTEGRAL_MAX_BITS

(Windows)

64

__INTEL_LLVM_COMPILER

(Windows, Linux)

The version of the compiler in the form VVVVMMUU , where VVVV is the major release version, MM is the minor release version, and UU is the update number. For example, the base release of 2021.1 is represented by the value 20210100.

This symbol is also recognized by CMake*.

Note

To uniquely identify the Intel® oneAPI DPC++/C++ Compiler, you must check for the existence of both __INTEL_LLVM_COMPILER and SYCL_LANGUAGE_VERSION, where SYCL_LANGUAGE_VERSION is part of the SYCL* spec.

__INTEL_MS_COMPAT_LEVEL

(Windows)

Defined as '1'.

__LIBSYCL_MAJOR_VERSION

Used to set the DPC++ runtime library major version.

__LIBSYCL_MINOR_VERSION

Used to set the DPC++ runtime library minor version.

__LIBSYCL_PATCH_VERSION

Used to set the DPC++ runtime library patch version.

__linux__

__linux

linux

(Linux)

Defined as '1' at the start of compilation.

__LONG_DOUBLE_SIZE__

(Windows*, Linux)

On Linux, defined as 80.

On Windows, defined as 64; defined as 80 when option /Qlong-double is specified.

__LONG_MAX__

(Linux)

9223372036854775807L

Note

Available only for compilations targeting Intel® 64 architecture.

__LP64__ (Linux)

__LP64 (Linux)

Defined as '1'.

Note

Available only for compilations targeting Intel® 64 architecture.

_M_IX86

(Windows)

700

_M_X64

(Windows)

Defined as '1' while building code targeting Intel® 64 architecture.

__MMX__

(Linux)

Defined as '1'.

On Linux, it is available only on systems based on Intel® 64 architecture.

_MSC_EXTENSIONS

(Windows)

This macro is defined when Microsoft extensions are enabled.

_MSC_FULL_VER

(Windows)

The Visual C++* version being used.

_MSC_VER

(Windows)

The Visual C++ version being used.

_MT

(Windows)

On Windows, defined as '1' when a multithreaded delay-locked loop (DLL) or library is used (when option /MD[d] or /MT[d] is specified).

__NO_MATH_INLINES

__NO_STRING_INLINES

(Linux)

Defined as '1'.

_OPENMP

(Windows, Linux)

201611 when you specify option [Q]openmp.

__OPTIMIZE__

(Linux)

Defined as '1'.

__pentium4

__pentium4__

(Linux)

Defined as '1'.

__PIC__

__pic__

(Linux)

On Linux, defined as '1' when option fPIC is specified.

__PTRDIFF_TYPE__

(Linux)

On Linux, defined as int on IA-32 architecture (C++ only); defined as long on Intel® 64 architecture.

__QMSPP_

(Windows)

Defined as '1'.

__REGISTER_PREFIX__

(Linux)

 

RESTRICT_WRITE_ACCESS_TO_CONSTANT_PTR

The specification assumes that the Data Parallel C++ (DPC++) implementation addresses space deduction. However, the deduction is performed in the middle end, where it is hard to provide user friendly diagnostics. When you write to raw pointers obtained from constant_ptr, there are no available diagnostics. You can enable diagnostics by enabling the RESTRICT_WRITE_ACCESS_TO_CONSTANT_PTR macro, which allows constant_ptr to use constant pointers as underlying pointer types. After enabling the macro, conversions from constant_ptr to raw pointers return constant pointers, and writing to const pointers is diagnosed by the front-end. This behavior does not follow the SYCL* specification, since constant_ptr conversions to the underlying pointer type will return pointers without any additional qualifiers. The macro is disabled by default.

__SIGNED_CHARS__

(Windows, Linux)

Defined as '1'.

_SIZE_T_DEFINED

(Windows)

Defined, no value.

__SIZE_TYPE__

(Linux)

On Linux, defined as unsigned on IA-32 architecture (C++ only); defined as unsigned long on Intel® 64 architecture.

__SSE__

(Windows, Linux)

On Linux, defined as '1' for processors that support SSE instructions.

On Windows, defined as '1'.

__SSE2__

(Windows, Linux)

On Linux, defined as '1' for processors that support Intel® SSE2 instructions.

__SSE3__

(Windows, Linux)

On Linux, defined as '1' for processors that support Intel® SSE3 instructions.

__SSE4_1__

(Windows, Linux)

On Linux, defined as '1' for processors that support Intel® SSE4 instructions.

__SSE4_2__

(Windows, Linux)

On Linux, defined as '1' for processors that support SSSE4 instructions.

__SSSE3__

(Windows, Linux)

On Linux, defined as '1' for processors that support SSSE3 instructions.

__SYCL_COMPILER_VERSION (Windows*, Linux*)

The build date of the SYCL* library, presented in the format YYYYMMDD.

Note

This is only available after the SYCL library headers are included in the source code.

SYCL_DISABLE_CPP_VERSION_CHECK_WARNING

(Windows, Linux)

Disables the warning displayed if the user tries to compile using an unsupported version of C++.

SYCL_LANGUAGE_VERSION

The SYCL_LANGUAGE_VERSION is defined only when compiling SYCL code.

SYCL_USE_NATIVE_FP_ATOMICS

Enable functions to generate native floating-point atomics on the target device by enabling the SYCL_USE_NATIVE_FP_ATOMICS macro. If the target device does not support floating-point atomics, emulated atomics are used instead. The macro is disabled by default.

SYCL2020_CONFORMANT_APIS

Enable compliance with the SYCL 2020 specification for non-compliant functions.

Some current SYCL function implementations do not conform to the SYCL 2020 specification and may result in an API break with a direct change.

The following non-compliant functions are deprecated:

  • sycl::get_native<backend::opencl,event>() with return type cl_event.

If a non-conforming function is used, the user is notified of the deprecated function and the compiler will suggest that the SYCL2020_CONFORMANT_APIS macro be enabled to enforce compliance. The user should re-write the non-compliant code to be compliant and re-compile with the SYCL2020_CONFORMANT_APIS macro enabled.

unix

__unix

__unix__

(Linux)

Defined as '1'.

__USER_LABEL_PREFIX__

(Linux)

 

_VA_LIST_DEFINED

(Windows)

Defined, no value.

__VERSION__

(Linux)

The compiler version string

__w64

(Windows)

Defined, no value.

__WCHAR_T

(Linux)

Defined as '1'.

_WCHAR_T_DEFINED

(Windows)

Defined when option /Zc:wchar_t is specified or "wctype_t" is defined in the header file.

__WCHAR_TYPE__

(Linux)

On Linux, defined as long int on IA-32 architecture (C++ only); defined as int on Intel® 64 architecture.

_WCTYPE_T_DEFINED

(Windows)

Defined when "wctype_t" is defined in the header file.

_WIN32

(Windows)

Defined as '1' while building code targeting IA-32 (C++ only) or Intel® 64 architecture.

_WIN64

(Windows)

Defined as '1' while building code targeting Intel® 64 architecture.

__WINT_TYPE__

(Linux)

Defined as unsigned int.

__x86_64

__x86_64__

(Linux)

Defined as '1' while building code targeting Intel® 64 architecture.

See Also