[Paper Review] Early Experiences Migrating CUDA codes to oneAPI
This paper evaluates the effectiveness of Intel's dpct tool in migrating CUDA code to oneAPI's DPC++ programming model, demonstrating that while dpct automates 80–90% of the migration, manual intervention is required for advanced CUDA features. The resulting DPC++ code achieves functional portability across diverse CPU and GPU architectures, including NVIDIA and Intel devices, with correct execution and measurable performance differences due to experimental oneAPI support for NVIDIA GPUs.
The heterogeneous computing paradigm represents a real programming challenge due to the proliferation of devices with different hardware characteristics. Recently Intel introduced oneAPI, a new programming environment that allows code developed in DPC++ to be run on different devices such as CPUs, GPUs, FPGAs, among others. This paper presents our first experiences in porting two CUDA applications to DPC++ using the oneAPI dpct tool. From the experimental work, it was possible to verify that dpct does not achieve 100% of the migration task; however, it performs most of the work, reporting the programmer of possible pending adaptations. Additionally, it was possible to verify the functional portability of the DPC++ code obtained, having successfully executed it on different CPU and GPU architectures.
Motivation & Objective
- To assess the effectiveness of Intel's dpct tool in automating the migration of CUDA code to DPC++ within the oneAPI ecosystem.
- To evaluate the functional portability of the generated DPC++ code across heterogeneous architectures, including CPUs and GPUs.
- To identify gaps in dpct's translation capability, particularly for advanced CUDA features like Cooperative Groups and CUDA-specific intrinsics.
- To analyze performance characteristics of migrated code on both NVIDIA and Intel hardware platforms.
- To provide insights for developers on the practicality and limitations of using oneAPI for CUDA code modernization.
Proposed method
- The study used the oneAPI dpct tool to automatically translate two CUDA applications—Matrix Multiplication and Reduction—from CUDA C++ to DPC++.
- The migration process involved translating kernel launches, memory management, and device-specific constructs, with dpct inserting comments to flag incomplete or non-translatable code sections.
- The resulting DPC++ code was compiled and executed on two hardware platforms: an NVIDIA RTX 2070 GPU and an Intel Core i9-10920X with Intel Iris Xe MAX GPU.
- Performance was measured across varying problem sizes (4096, 8192, 16384) for matrix multiplication, comparing CUDA and DPC++ execution times.
- The DPC++ code was validated for correctness and functional equivalence across different architectures, including non-Intel GPUs via experimental oneAPI support.
- Manual adjustments were made to the build process to enable DPC++ execution on NVIDIA GPUs, as native support was not available by default.
Experimental results
Research questions
- RQ1To what extent does the dpct tool automate the migration of CUDA code to DPC++ in practice?
- RQ2How effective is the functional portability of the generated DPC++ code across different CPU and GPU architectures?
- RQ3What are the performance implications of running migrated DPC++ code on NVIDIA GPUs, given experimental oneAPI support?
- RQ4Which CUDA-specific features are not fully supported by dpct, and what manual effort is required to address them?
- RQ5Can the DPC++ code be simplified or optimized further after automatic translation without breaking correctness?
Key findings
- The dpct tool successfully automated 80–90% of the CUDA-to-DPC++ migration, significantly reducing manual effort for porting legacy CUDA code.
- The tool inserted comments to flag non-translatable CUDA features, such as Cooperative Groups and __shfl_down_sync, requiring manual adaptation.
- The DPC++ code was functionally correct and successfully executed on both Intel CPUs and GPUs, as well as on an NVIDIA RTX 2070 GPU, confirming cross-architecture portability.
- On the NVIDIA RTX 2077, DPC++ execution times were 10–15% higher than CUDA for smaller matrices, but the performance gap widened with larger problem sizes (e.g., 38% slower at 16384×16384), likely due to suboptimal code generation.
- The performance overhead on NVIDIA GPUs is attributed to experimental oneAPI support and lack of targeted optimization passes, indicating significant potential for improvement with future compiler enhancements.
- Despite increased code complexity post-translation, the DPC++ code adhered to SYCL/DPC++ conventions and could be further simplified with manual refactoring.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.