Intel® oneAPI DPC++/C++ Compiler Developer Guide and Reference

ID 767253
Date 3/31/2023
Public

A newer version of this document is available. Customers should click here to go to the newest version.

Document Table of Contents

Additional Predefined Macros

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

Macro OS Support Description

__AVX__

Linux

Windows

Linux: Defined as 1 when option -march=corei7-avx, -xAVX, or higher processor targeting options are specified.

Windows: Defined as 1 when option /QxAVX or higher processor targeting options are specified.

__AVX2__

Linux

Windows

Linux: Defined as 1 when option -march=core-avx2,-xCORE-AVX2, or higher processor targeting options are specified.

Windows: Defined as 1 when option /QxCORE-AVX2 or higher processor targeting options are specified.

NOTE:

When any of the above options are specified, they also define macro AVX.

__AVX512BW__

Linux

Windows

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

__AVX512CD__

Linux

Windows

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

__AVX512DQ__

Linux

Windows

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

__AVX512ER__

Linux

Windows

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

__AVX512F__

Linux

Windows

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

__AVX512PF__

Linux

Windows

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

__AVX512VL__

Linux

Windows

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

__BASE_FILE__

Linux

Windows

Name of source file.

__COUNTER__

Linux

Windows

Defined as zero.

__cplusplus

Linux

Defined when compiling C++. The setting depends on which -std=c++nn option is in effect. The default is 201703L.

__ELF__

Linux

Defined as 1 at the start of compilation.

__EXCEPTIONS

Linux

Defined as 1 when C++ exceptions are enabled (default for C++). Not defined in C or when option -fno-exceptions is specified.

__gnu_linux__

Linux

Defined as 1 at the start of compilation.

__GNUC__

Linux

Defined as 4.

__GNUC_MINOR__

Linux

Defined as 2.

__GNUC_PATCHLEVEL__

Linux

Defined as 1.

__GNUG__

Linux

Defined as 4 when compiling C++.

_INTEGRAL_MAX_BITS

Windows

Defined as 64.

__INTEL_LLVM_COMPILER

Linux

Windows

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 2023.1 is represented by the value 20230100.

This symbol is also recognized by CMake.

NOTE:
To 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.

__LIBSYCL_MAJOR_VERSION

Linux

Windows

Set to the SYCL runtime library major version.

__LIBSYCL_MINOR_VERSION

Linux

Windows

Set to the SYCL runtime library minor version.

__LIBSYCL_PATCH_VERSION

Linux

Windows

Set to the SYCL runtime library patch version.

__linux__

__linux

linux

Linux

Defined as 1 at the start of compilation.

__LONG_DOUBLE_SIZE__

Linux

Windows

Linux: Defined as 80.

Windows: Defined as 64. However, if option Qlong-double is specified, it is defined as 80.

__LONG_MAX__

Linux

Windows

Linux: Defined as 9223372036854775807L.

Windows: Defined as 2147483647L.

__LP64__

Linux

Defined as 1.

_M_X64

Windows

Defined as 100.

MKL_ILP64

Linux

Windows

Defined as 1 when -qmkl-ilp64 or /Qmkl-ilp64 is specified on the command line, or when used with -fsycl -qmkl.

__MMX__

Linux

Defined as 1.

_MSC_EXTENSIONS

Windows

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

Defined as 1 when a multithreaded dynamic-link library (DLL) is used (that is, when option /MD[d] or /MT[d] is specified).

__NO_MATH_INLINES

Linux

Windows

Defined as 1.

_OPENMP

Linux

Windows

The default is 201811 when you specify option [q or Q]openmp.

__OPTIMIZE__

Linux

Windows

Defined as 1 when optimization is used.

Not defined if option -O0 is specified or in effect.

__pentium4

__pentium4__

Linux

Defined as 1.

__PIC__

__pic__

Linux

Windows

Linux: Defined as 1 when option -fpic is specified.

Windows: Defined as 2.

__PTRDIFF_TYPE__

Linux

Windows

Linux: Defined as long int.

Windows: Defined as long long int.

__REGISTER_PREFIX__

Linux

Sets the prefix applied to CPU register names in assembly language. 

RESTRICT_WRITE_ACCESS_TO_CONSTANT_PTR

Linux

Windows

Due to implementation limitations, writing to raw pointers obtained from constant_ptr is not diagnosed by default. You can enable diagnostics by setting 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.

This macro is disabled by default.

__SIZE_TYPE__

Linux

Windows

Linux: Defined as unsigned long int.

Windows: Defined as unsigned long long int.

__SSE__

Linux

Windows

Defined as 1 for processors that support SSE instructions.

__SSE2__

Linux

Windows

Defined as 1 for processors that support Intel® SSE2 instructions.

__SSE3__

Linux

Windows

Defined as 1 for processors that support Intel® SSE3 instructions.

__SSE4_1__

Linux

Windows

Defined as 1 for processors that support Intel® SSE4 instructions.

__SSE4_2__

Linux

Windows

Defined as 1 for processors that support SSSE4 instructions.

__SSSE3__

Linux

Windows

Defined as 1 for processors that support SSSE3 instructions.

__SYCL_COMPILER_VERSION

Linux

Windows

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_LANGUAGE_VERSION

Linux

Windows

An integer reflecting the version number and revision of the SYCL language that is supported by the implementation.

Enables compliance with the SYCL 2020 specification.

SYCL_USE_NATIVE_FP_ATOMICS

Linux

Windows

Enables functions to generate built-in floating-point atomics on the target device. If the target device does not support floating-point atomics, emulated atomics are used instead.

Enabled by default for for non-FPGA SPIR-V* targets.

SYCL2020_CONFORMANT_APIS

Linux

Windows

Enables compliance with the SYCL 2020 specification. It is useful because some current implementations may be widespread and not conform to that specification.

When this macro is defined, it currently has no effect on the API.

unix

__unix

__unix__

Linux

Defined as 1.

__USER_LABEL_PREFIX__

Linux

The prefix applied to user labels in assembly language. 

__VERSION__

Linux

The compiler version string.

__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

Windows

Linux: Defined as int.

Windows: Defined as unsigned short int.

_WCTYPE_T_DEFINED

Windows

Defined when wctype_t is defined in the header file.

_WIN64

Windows

Defined as 1.

__WINT_TYPE__

Linux

Windows

Linux: Defined as unsigned int.

Windows: Defined as unsigned short int.

__x86_64

__x86_64__

Linux

Defined as 1.

See Also