Frequently Asked Questions (FAQ)
Enabling C++ Features
Migrating a CMake* Project on Windows
- You can migrate the source files in a command line by using the--vcxprojfileoption of the Intel® DPC++ Compatibility Tool
- You can migrate the entire project in Microsoft Visual Studio with an Intel® DPC++ Compatibility Tool Microsoft Visual Studio plugin.
Errors When Migrating a Batch of Files with dpct --in-root=srcdir --out-root=dstdir *.cu
- Rely on the Intel® DPC++ Compatibility Tool to decide which files to migrate with:compile_commands.json: “dpct -p=compile_commands.json --in-root=srcdir --out-root=dstdir”
- Manually pass specific files to migrate, but do not pass the files that are included in other files and not supposed to be compiled as a standalone file in the original application. The header files are migrated automatically when they are included by the files provided as the input to the tool and are located within thein-rootfolder:dpct --in-root= srcdir --out-root=dstdir sample.cu
Formatting the Migrated Code
- The Intel® DPC++ Compatibility Tool will try to detect the indent size of the original code and apply it to the resulting code. You can guide the tool by settingTabWidthandUseTabin.clang-formatfile. Because the input source code is not well formatted, the indents in the resulting code may still be inconsistent.
- Run the Intel® DPC++ Compatibility Tool with the--format-range=alloption to format the entire resulting file. The change between input source code and resulting source code may be large and make it more difficult to compare the code.
- Format your input source code, then use the Intel® DPC++ Compatibility Tool with the same.clang-formatfile for migration.