Migrate a Project on Windows*
Use the Command Line
The Intel® DPC++ Compatibility Tool can be invoked at the command line.
If your project uses Microsoft Visual Studio*, you can use the
--vcxprojfile
option to point to the project that requires
migration. The Intel® DPC++ Compatibility Tool will migrate the files you
provided as input files. For example:- Open the Vector Add sample in one of the following ways:
- Use theoneapi-cliutility to select the Vector Add sample from theIntel® DPC++ Compatibility Toolcategory.
- Download the Vector Add sample from GitHub*: https://github.com/oneapi-src/oneAPI-samples/tree/master/Tools/Migration
- Navigate to the root of the Vector Add sample project.
- From the root folder of the sample project, run the Intel® DPC++ Compatibility Tool.To migrate the single filesrc\vector_add.cu, which is part ofvector-add.vcxproj, run:dpct --vcxprojfile=vector-add.vcxproj --in-root=./ --out-root=output_proj src\vector_add.cuAlternately, to migrate all relevant files found by the tool invector-add.vcxproj, run:dpct --vcxprojfile=vector-add.vcxproj --in-root=./ --out-root=output_projIn both cases, the result of the migration is sent to theoutput_projfolder.
Use Microsoft Visual Studio*
You can use the Intel® DPC++ Compatibility Tool within the Microsoft Visual Studio
IDE to migrate your project to a DPC++ project.
Step 1: Select an Existing Project and Start Migration
To select an existing project in Microsoft Visual Studio and start
migration:
- From theExtensionsmenu, selectBrowse Intel® oneAPI Samples
- SelectRodinia NW DPCTfrom theIntel® DPC++ Compatibility Toolcategory.
- Select theProjectmenu>Migrate Project to DPC++.
- In theSelect Project to Migratedialog, clickBrowse.
- Select the directory and the existing project file in theOpendialog.
- Select theConfigurationandPlatformto migrate.
- ClickOK.
Step 2: Specify the Migration Configuration
After selecting an existing project, you will see the
Migration
Configuration
dialog. These configurations have default values.
You can specify the configurations, including the new
project file name and directory, the --in-root
argument, and
the additional options for the migration.The command line area is
read-only and shows the command line that will be used to migrate
the project.
The migration starts once you click
OK
.Step 3: Verify the Source for Correctness
Verify the migration of the source code that uses variables declared using
preprocessor directives. Inspect the migrated source code, address any DPCT
warnings generated, and verify correctness of the new program.
Review Emitted Warnings for additional information about inserted warnings
and comments.
For the most accurate and detailed
instructions on addressing warnings, see the
Addressing Warnings
in the Migrated Code
section of the sample README files.Step 4: Check the Detailed Diagnostic Messages
To learn more about a diagnostic message, click the
Help
hyperlink in the
Actions
column, which is located in the table in the Intel® DPC++ Compatibility Tool
view. Details about why the diagnostic message is generated and information on
how to fix the issue are shown.Specifying Options
You can set your preferences for the Intel® DPC++ Compatibility Tool
within Microsoft Visual Studio:
- To always show warnings after migration:
- SelectTools>Options>Intel® DPC++ Compatibility Tool>General.
- SelectTrue(the default) for theAlways show warnings after migrationoption.
- ClickOK.
- To enable opening code side-by-side:
- SelectTools>Options>Intel® DPC++ Compatibility Tool>General.
- SelectTrue(the default) for theEnable opening code side-by-sideoption.
- ClickOK.
- To select a version of the tool:If you have multiple versions of the Intel® DPC++ Compatibility Tool installed, you can select which version to use.
- SelectTools>Options>Intel® DPC++ Compatibility Tool>Tools.
- Use the drop-down menu from the step above to select the appropriate version of the tool.
- Select the default options (optional).
- ClickOK.