Intel® oneAPI DPC++/C++ Compiler Developer Guide and Reference
ID
767253
Date
7/13/2023
Public
A newer version of this document is available. Customers should click here to go to the newest version.
Create a New Project
Use the Intel® oneAPI DPC++/C++ Compiler
Switch Back to the MSVC Compiler
Enable an Intel® oneAPI DPC++ Compiler Runtime Environment when using the MSVC Compiler
Verify Use of the Intel® oneAPI DPC++/C++ Compiler
Unsupported MSVC Project Types
Tips for Use
Select the Compiler Version
Specify a Base Platform Toolset
Use Property Pages
Use Intel® Libraries with Microsoft Visual Studio*
Include MPI Support
Dialog Box Help
Alphabetical Option List
General Rules for Compiler Options
What Appears in the Compiler Option Descriptions
Optimization Options
Code Generation Options
Interprocedural Optimization Options
Advanced Optimization Options
Profile Guided Optimization Options
Optimization Report Options
Offload Compilation, OpenMP*, and Parallel Processing Options
Floating-Point Options
Inlining Options
Output, Debug, and Precompiled Header Options
Preprocessor Options
Component Control Options
Language Options
Data Options
Compiler Diagnostic Options
Compatibility Options
Linking or Linker Options
Miscellaneous Options
Deprecated and Removed Compiler Options
Display Option Information
Alternate Compiler Options
Portability and GCC-Compatible Warning Options
arch
ax, Qax
EH
fasynchronous-unwind-tables
fcf-protection, Qcf-protection
fdata-sections, Gw
fexceptions
ffunction-sections, Gy
fomit-frame-pointer
Gd
GR
guard
Gv
m, Qm
m64, Qm64
m80387
march
masm
mauto-arch, Qauto-arch
mbranches-within-32B-boundaries, Qbranches-within-32B-boundaries
mintrinsic-promote, Qintrinsic-promote
momit-leaf-frame-pointer
mtune, tune
regcall, Qregcall
x, Qx
xHost, QxHost
ffreestanding, Qfreestanding
fjump-tables
fvec-peel-loops, Qvec-peel-loops
fvec-remainder-loops, Qvec-remainder-loops
fvec-with-mask, Qvec-with-mask
ipp-link, Qipp-link
mno-gather, Qgather-
mno-scatter, Qscatter-
qactypes, Qactypes
qdaal, Qdaal
qipp, Qipp
qmkl, Qmkl
qmkl-ilp64, Qmkl-ilp64
qopt-assume-no-loop-carried-dep, Qopt-assume-no-loop-carried-dep
qopt-dynamic-align, Qopt-dynamic-align
qopt-for-throughput, Qopt-for-throughput
qopt-mem-layout-trans, Qopt-mem-layout-trans
qopt-multiple-gather-scatter-by-shuffles, Qopt-multiple-gather-scatter-by-shuffles
qopt-prefetch, Qopt-prefetch
qopt-streaming-stores, Qopt-streaming-stores
qtbb, Qtbb
unroll, Qunroll
use-intel-optimized-headers, Quse-intel-optimized-headers
vec, Qvec
vec-threshold, Qvec-threshold
device-math-lib
fintelfpga
fiopenmp, Qiopenmp
flink-huge-device-code
fno-sycl-libspirv
foffload-static-lib
fopenmp
fopenmp-declare-target-scalar-defaultmap, Qopenmp-declare-target-scalar-defaultmap
fopenmp-device-lib
fopenmp-target-buffers, Qopenmp-target-buffers
fopenmp-targets, Qopenmp-targets
fsycl
fsycl-add-targets
fsycl-dead-args-optimization
fsycl-device-code-split
fsycl-device-lib
fsycl-device-obj
fsycl-device-only
fsycl-early-optimizations
fsycl-enable-function-pointers
fsycl-esimd-force-stateless-mem
fsycl-explicit-simd
fsycl-force-target
fsycl-help
fsycl-host-compiler
fsycl-host-compiler-options
fsycl-id-queries-fit-in-int
fsycl-instrument-device-code
fsycl-link
fsycl-link-huge-device-code
fsycl-link-targets
fsycl-max-parallel-link-jobs
fsycl-optimize-non-user-code
fsycl-rdc
fsycl-targets
fsycl-unnamed-lambda
fsycl-use-bitcode
ftarget-compile-fast
nolibsycl
qopenmp, Qopenmp
qopenmp-link
qopenmp-simd, Qopenmp-simd
qopenmp-stubs, Qopenmp-stubs
reuse-exe
Wno-sycl-strict
Xopenmp-target
Xs
Xsycl-target
ffp-contract
fimf-absolute-error, Qimf-absolute-error
fimf-accuracy-bits, Qimf-accuracy-bits
fimf-arch-consistency, Qimf-arch-consistency
fimf-domain-exclusion, Qimf-domain-exclusion
fimf-max-error, Qimf-max-error
fimf-precision, Qimf-precision
fimf-use-svml, Qimf-use-svml
fma, Qfma
fp-model, fp
fp-speculation, Qfp-speculation
ftz, Qftz
pc, Qpc
w
w, W
Wabi
Wall
Wcheck-unicode-security
Wcomment
Wdeprecated
Weffc++, Qeffc++
Werror, WX
Werror-all
Wextra-tokens
Wformat
Wformat-security
Wmain
Wmissing-declarations
Wmissing-prototypes
Wpointer-arith
Wreorder
Wreturn-type
Wshadow
Wsign-compare
Wstrict-aliasing
Wstrict-prototypes
Wtrigraphs
Wuninitialized
Wunknown-pragmas
Wunused-function
Wunused-variable
Wwrite-strings
Create Libraries
Use Intel Shared Libraries on Linux
Manage Libraries
Redistribute Libraries When Deploying Applications
Resolve References to Shared Libraries
Intel's Memory Allocator Library
SIMD Data Layout Templates
Intel® C++ Class Libraries
Intel's C++ Asynchronous I/O Extensions for Windows
IEEE 754-2008 Binary Floating-Point Conformance Library
Intel's Numeric String Conversion Library
Terms and Syntax
Rules for Operators
Assignment Operator
Logical Operators
Addition and Subtraction Operators
Multiplication Operators
Shift Operators
Comparison Operators
Conditional Select Operators
Debug Operations
Unpack Operators
Pack Operators
Clear MMX™ State Operator
Integer Functions for Intel® Streaming SIMD Extensions
Conversions between Fvec and Ivec
Fvec Syntax and Notation
Data Alignment
Conversions
Constructors and Initialization
Arithmetic Operators
Minimum and Maximum Operators
Logical Operators
Compare Operators
Conditional Select Operators for Fvec Classes
Cacheability Support Operators
Debug Operations
Load and Store Operators
Unpack Operators
Move Mask Operators
aio_read
aio_write
Example for aio_read and aio_write Functions
aio_suspend
Example for aio_suspend Function
aio_error
aio_return
Example for aio_error and aio_return Functions
aio_fsync
aio_cancel
Example for aio_cancel Function
lio_listio
Example for lio_listio Function
Asynchronous I/O Function Errors
Intel® IEEE 754-2008 Binary Floating-Point Conformance Library and Usage
Function List
Homogeneous General-Computational Operations Functions
General-Computational Operation Functions
Quiet-Computational Operations Functions
Signaling-Computational Operations Functions
Non-Computational Operations Functions
Compilation Overview
Supported Environment Variables
Pass Options to the Linker
Specify Alternate Tools and Paths
Use Configuration Files
Use Response Files
Global Symbols and Visibility Attributes for Linux*
Save Compiler Information in Your Executable
Link Debug Information
Ahead of Time Compilation
Device Offload Compilation Considerations
Use a Third-Party Compiler as a Host Compiler for SYCL Code
Use the Intel® oneAPI DPC++/C++ Compiler
To use the compiler with Microsoft Visual C++ (MSVC):
- Create a MSVC project, or open an existing project.
- In Solution Explorer, select the project(s) to build with Intel® oneAPI DPC++/C++ Compiler.
- Open Project > Properties.
- In the left pane, expand the Configuration Properties category and select the General property page.
- In the right pane, change the Platform Toolset to <compiler selection>. Alternatively, you can change the toolset by selecting Project > Intel Compiler > Use Intel oneAPI DPC++/C++ Compiler. This sets whichever version of the compiler that you specify as the toolset for all supported platforms and configurations.
NOTE:Select Intel(R) oneAPI DPC++ Compiler to invoke icx-cl -fsycl. Select Intel C++ Compiler <major version> (example 2021) to invoke icx or Intel C++ Compiler <major.minor> (example 19.2) to invoke icl.
- To add options, go to Project > Properties > C/C++ > Command Line and add new options to the Additional Options field. Alternatively, you can select options from Intel specific properties. Refer to complete list of options in the Compiler Options section in this documentation.
- Rebuild, using either Build > Project only > Rebuild for a single project, or Build > Rebuild Solution for a solution.
Switch Back to the MSVC Compiler
If your project is using the Intel® oneAPI DPC++/C++ Compiler, you can switch back to MSVC:
- Select your project.
- Right-click and select Intel Compiler > Use Visual C++ from the context menu.
Enable an Intel® oneAPI DPC++ Compiler Runtime Environment when using the MSVC Compiler
There are two ways to enable the Intel® oneAPI DPC++ Compiler runtime environment for an MSVC project.
Enable for a Current Configuration
- Select your project, then select Project > Properties.
- In the left pane, select Configuration Properties > Debugging.
- In the right pane, set Enable Intel® oneAPI DPC++ Compiler Runtime Environment to Yes.
Enable for All Configurations
- Select your project.
- There are two ways to enable the runtime environment:
- From the main menu, select Project > Enable Intel® oneAPI DPC++ Compiler Runtime Environment.
- Right-click and select Enable DPC++ Runtime Environment from the context menu.
Verify Use of the Intel® oneAPI DPC++/C++ Compiler
To verify the use of the Intel® oneAPI DPC++/C++ Compiler:
- Go to Project > Properties > C/C++ > General.
- Set Suppress Startup Banner to No. Click OK.
- Rebuild your application.
- Look at the Output window.
You should see a message similar to the following when using the Intel® oneAPI DPC++/C++ Compiler:
Intel(R) oneAPI DPC++/C++ Compiler for applications running on XXXX, Version XX.X.X
Unsupported MSVC Project Types
The following project types are not supported:
- Class Library
- CLR Console Application
- CLR Empty Project
- Windows Forms Application
- Windows Forms Control Library
Tips for Use
- Create a separate configuration for building with Intel® oneAPI DPC++/C++ Compiler:
- After you have created your project and specified it as an Intel project, create a new configuration (for example, rel_intelc based on Release configuration or debug_intelc based on Debug configuration).
- Add any special optimization options offered by Intel® oneAPI DPC++/C++ Compiler only to this new configuration (for example, rel_intelc or debug_intelc) through the project property page.
- Build with Intel® oneAPI DPC++/C++ Compiler.
Parent topic: Use Microsoft Visual Studio