Workflow for a CUDA* to SYCL* Migration
Migrate existing CUDA code to SYCL using the Intel DPC++ Compatibility Tool. The tool ports CUDA language kernels and library API calls, and migrates most of the CUDA code to the architecture and vendor-portable SYCL code.
Learn with a Code Sample
To help you decide how to migrate your CUDA sources, use the following resources:
- Guide to migrating a Jacobi sample: CUDA to SYCL Migration–Jacobi Iterative Method.
Get a detailed analysis of the migration with explicit explanations of the migration process and CUDA to SYCL mappings.
- Original CUDA source code: JacobiCUDAGraphs.zip.
- Migrated SYCL source code from Intel: Jacobi Iterative Solver.
The samples include separate sources that reflect the distinct workflow stages.
Note To learn more about SYCL and understand how the Intel DPC++ Compatibility Tool changed the source code, see CUDA to SYCL Migration–Jacobi Iterative Method. This guide explains the technical details between CUDA and SYCL mappings using the Jacobi sample.
The manually migrated SYCL code uses actual SYCL calls and syntax that directly maps to CUDA calls. This method gives cleaner migrated code and makes it easier to follow the code. The code functionality between the two is nearly identical.
For technical details between CUDA and SYCL mappings using the Jacobi sample, see the instructions in the CUDA to SYCL Migration–Jacobi Iterative Method. This guide explains the underlying concepts of CUDA and SYCL, and the essential terms for migrating the code.
Although there are common steps for offloading and setting up asynchronous streams and memory allocation and copy, the actual work happens in the offload computation. CUDA and SYCL share some basic concepts about creating offload kernels that run on a GPU. To efficiently understand the SYCL syntax, map many of these concepts by identifying the similarities and differences:
- CUDA thread block and SYCL work group
- Shared local memory (SLM) access
- CUDA thread block and SYCL barrier synchronization
- CUDA cooperative group and SYCL subgroup
- CUDA warp primitives and SYCL group algorithms
- CUDA and SYCL atomics