Migrate a Project on Windows*

Use the Command Line

Migrate a vcxproj Project

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:

  1. Open the Vector Add sample in one of the following ways:

    1. Use the oneapi-cli utility to select a sample from the Intel® DPC++ Compatibility Tool category.

    2. Download from GitHub*: https://github.com/oneapi-src/oneAPI-samples/tree/master/Tools/Migration

  2. Navigate to the root of the sample project.

    1
     dpct --vcxprojfile=vector-add.vcxproj --in-root=./ --out-root=output_proj src\vector_add.cu
    

    The command specified above migrates src\vector_add.cu, which is part of vector-add.vcxproj. The result of the migration is sent to the output_proj folder.

    -OR-

    1
    dpct --vcxprojfile=vector-add.vcxproj --in-root=./ --out-root=output_proj
    

    The command specified above migrates all relevant files the tool found in vector-add.vcxproj. The result of the migration is sent to the output_proj folder.

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:

  1. From the Extensions menu, select Browse Intel® oneAPI Samples

  2. Select Rodinia NW DPCT from the Intel® DPC++ Compatibility Tool category.

  3. Select the Project menu >Migrate Project to DPC++.

  4. In the Select Project to Migrate dialog, click Browse.

  5. Select the directory and the existing project file in the Open dialog.

  6. Select the Configuration and Platform to migrate.

  7. Click OK.

Step 2: Specify the Migration Configuration

After selecting an existing project, you will see the Migration Configuration dialog. These configurations have default values. You are able to 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 that are declared using preprocessor directives. Inspect the migrated source code, address any DPCT warnings generated, and verify correctness of the new program. For the most accurate and detailed instructions on addressing warnings, see the Addressing Warnings in the Migrated Code section of the sample README files.

Note

Emitted Warnings

The Intel® DPC++ Compatibility Tool notes the places in the code that may require your attention during the migration of the files in order to make the code DPC++ compliant or correct. Comments are inserted into the generated source files and displayed as warnings in the output. For more details on what a particular warning means, see the Diagnostics Reference. An example is below:

1
2
3
/path/to/file.hpp:26:1: warning: DPCT1003:0: Migrated API does not return error code. (*,0) is inserted. You may need to rewrite this code.
// source code line for which warning was generated
^

Step 4: Check the Detailed Diagnostic Messages

To learn more details 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. The detail 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 using the Intel® DPC++ Compatibility Tool within Microsoft Visual Studio:

  • To always show warnings after migration:

    1. Select Tools > Options > Intel® DPC++ Compatibility Tool > General.

    2. Select True (the default) for the Always show warnings after migration option.

    3. Click OK.

  • To enable opening code side-by-side:

    1. Select Tools > Options > Intel® DPC++ Compatibility Tool > General.

    2. Select True (the default) for the Enable opening code side-by-side option.

    3. Click OK.

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

    1. Select Tools > Options > Intel® DPC++ Compatibility Tool > Tools.

    2. Use the drop-down menu from the step above to select the appropriate version of the tool.

    3. Select the default options (optional).

    4. Click OK.