Developer Guide and Reference

  • 2021.2
  • 04/07/2021
  • Public Content
  • Download as PDF
Contents

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.
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.
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) Prefetch instructions.
__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 information for Intel compilers.
Format is YYYYMMPP where:
  • YYYY - Major version
  • MM - Minor version
  • PP - Patch version
Example: 20210200 or 2021.2.0
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
Available only for compilations targeting Intel® 64 architecture.
__LP64__
(Linux)
__LP64
(Linux)
Defined as '1'.
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 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.
This is only available after the SYCL library headers are included in the source code.
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.

Product and Performance Information

1

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