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.x, 10.x, and 11.0–11.6.
- 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
Vector Add DPCT
The Vector Add DPCT sample demonstrates how to migrate a simple program from CUDA to SYCL. Vector Add provides an easy way to verify that your development environment is setup correctly to use the Intel® DPC++ Compatibility Tool.
Folder Options DPCT
The Folder Options DPCT sample shows how to migrate more complex projects and to use options.
Rodinia NW DPCT
The Rodinia NW DPCT sample demonstrates how to migrate a Make/CMake project from CUDA to SYCL using the Intel® DPC++ Compatibility Tool.
- use theoneapi-cliutility to select a sample from the Intel® DPC++ Compatibility Tool category, or
- 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. The file is now a SYCL source file.
- Navigate to the new SYCL source file:cd dpct_outputVerify the generated source code and fix any code that the Intel® DPC++ Compatibility Tool was unable to migrate. (The code used in this example is simple, so manual changes may not be needed). For the most accurate and detailed instructions on addressing warnings emitted from the Intel® DPC++ Compatibility Tool, see theAddressing Warnings in Migrated Codesection of the README files.To compile the migrated sample, add-I<dpct_root_folder>/includeto your compile command.
Detailed overview of Intel® DPC++ Compatibility Tool features, workflow, and use.
How to migrate CUDA code to Data Parallel C++ (DPC++) using the Intel® DPC++ Compatibility Tool, a one-time migration engine that ports both kernels and API calls.
Detailed instructions on how to get and install Intel® oneAPI packages using different installer modes and package managers.
The SYCL Specification PDF. Explains how SYCL integrates OpenCL devices with modern C++.
The SYCL 2020 Specification PDF.
An overview of SYCL provided by the Khronos Group.
Description of CUDA support in clang.
Proposed extensions to the SYCL specification.
Add oneAPI components to a Yocto project build using the meta-intel layers.