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® 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® 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.