29797

TransCL: An Automatic CUDA-to-OpenCL Programs Transformation Framework

Changqing Shi, Yufei Sun, Rui Chen, Jiahao Wang, Qiang Guo, Chunye Gong, Yicheng Sui, Yutong Jin, Yuzhi Zhang
Software College, Nankai University, Tianjin, China
ACM Transactions on Architecture and Code Optimization, 2025

@article{shi2025transcl,

   title={TransCL: An Automatic CUDA-to-OpenCL Programs Transformation Framework},

   author={Shi, Changqing and Sun, Yufei and Chen, Rui and Wang, Jiahao and Guo, Qiang and Gong, Chunye and Sui, Yicheng and Jin, Yutong and Zhang, Yuzhi},

   journal={ACM Transactions on Architecture and Code Optimization},

   year={2025},

   publisher={ACM New York, NY}

}

With the rising demand for computational power and the increasing variety of computational scenarios, considerable interest has emerged in transforming existing CUDA programs into more general-purpose OpenCL programs, enabling them to run across diverse hardware platforms. However, manual methods, typically designed for specific applications, lack flexibility. Current automated conversion techniques also face considerable challenges, particularly in handling diverse programming interfaces, memory management, etc., and are insufficient for converting large-scale, complex CUDA projects. In this paper, we propose a novel source-to-source program transformation framework, TransCL, which automates the conversion of CUDA programs in four key aspects: source code, execution model, programming model and memory model. To achieve this, we abstract a set of conversion rules aligned with the latest CUDA standards, develop a transcoder, implement an OpenCL-compatible programming interface library, and establish a memory mapping mechanism between CUDA and OpenCL. Experiments demonstrate that TransCL provides a high level of automation in converting CUDA-based applications and is effective in handling large, complex projects such as TensorFlow. Moreover, the converted AI framework successfully conducted model training for the first time. The experiment also validates that the converted program can execute correctly across multiple platforms and demonstrate good performance.
No votes yet.
Please wait...

* * *

* * *

HGPU group © 2010-2025 hgpu.org

All rights belong to the respective authors

Contact us: