Get Started with the Intel® DPC++ Compatibility Tool
Before You Begin
- /usr/local/cuda-x.y/include, wherex.yis one of these values: 8.0, 9.0, 9.1, 9.2, 10.0, 10.1, 10.2, 11.0, or 11.1
- On Linux (sudo):source /opt/intel/oneapi/setvars.sh
- On Linux (user):source ~/intel/oneapi/setvars.sh
- On Windows:Drive:\Program Files (x86)\Intel\oneAPI\setvars.bat
dpct [options] [<source0>... <sourceN>]
dpct -- -help
/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 ^
Migrate a Simple Test Project
- Use the oneapi-cli utility to select a sample from the Intel® DPC++ Compatibility Tool category.
Vector Add DPCT
This sample demonstrates how to migrate a simple program from CUDA to Data Parallel C++. Vector Add provides an easy way to verify that your development environment is setup correctly to use the Intel® DPC++ Compatibility Tool (dpct).
Folder Options DPCT
This sample provides an example of how to migrate more complex projects and use options.
Rodinia NW DPCT
This sample demonstrates how to migrate a Make/CMake project from CUDA to Data Parallel C++ using the Intel® DPC++ Compatibility Tool.
- Download thevector_add.cusample.
- Run the Intel® DPC++ Compatibility Tool from the sample root directory:dpct --in-root=. src/vector_add.cuThevector_add.dp.cppfile should appear in thedpct_outputdirectory. Use:cd dpct_outputThe file is now a DPC++ source file.
- Verify the generated source code and fix the code that the Intel® DPC++ Compatibility Tool was unable to migrate. (The code used in this example is simple. In this instance, manual changes may not be needed). For the most accurate and detailed instructions on addressing warnings, see theAddressing Warnings in the Migrated Codesection of the README files.You must add-I<dpct_root_folder>/includefor the compilation of the migrated sample.For more complex sample instructions, see the Migrate a Project section of the Intel® DPC++ Compatibility Tool Developer Guide and Reference.
Description and Links
Intel® DPC++ Compatibility Tool Developer Guide and Reference
On-Demand Webinar: Migrating Your Existing CUDA Code to DPC++ Code
Installation Guides for Intel® oneAPI Toolkits
SYCL specification version 1.2.1 PDF
Khronos* SYCL overview site
CUDA support in Clang
Proposed extensions to the SYCL specification