###
计算机系统应用英文版:2022,31(5):351-357
本文二维码信息
码上扫一扫!
一种Fortran到CUDA C的转换方法
(1.中国科学院 计算机网络信息中心, 北京 100190;2.中国科学院大学, 北京 100049)
Conversion Method from Fortran to CUDA C
(1.Computer Network Information Center, Chinese Academy of Sciences, Beijing 100190, China;2.University of Chinese Academy of Sciences, Beijing 100049, China)
摘要
图/表
参考文献
相似文献
本文已被:浏览 527次   下载 1264
Received:July 09, 2021    Revised:August 04, 2021
中文摘要: 基于GPU的异构计算逐渐成为主流计算方法, 但限于科学计算编程的历史发展, 大量的数值计算软件仍以Fortran语言实现. 为了提高计算速度, 大量的软件需要移植为CUDA C, 但人工实现程序移植是一项浩繁的工程. 若能实现从Fortran到CUDA C的自动转换, 可以极大的提高程序开发效率. 本文设计了将Fortran转换为CUDA C的算法, 并基于正则表达式和shell脚本实现了该算法, 编写测试用例进行了验证. 实验表明, 该算法可靠稳定兼容性好, 在大型程序的移植过程中, 能够自动筛选并建立变量信息表, 生成CUDA相关操作函数, 且结果代码可读性较好, 转化正确率达80%以上, 有效减少了移植的工作量.
中文关键词: Fortran  CUDA C  并行计算  正则表达式
Abstract:Graphic processing unit (GPU)-based heterogeneous computing has gradually become the mainstream computing method. Nevertheless, due to the limited historical development of scientific computing programming, a lot of numerical computing software is still implemented in Fortran. In terms of increasing the computing speed, a large amount of software needs to be transplanted onto compute unified device architecture (CUDA) C. However, it would be a complicated and massive project to manually implement the program transplant. If automatic conversion from Fortran to CUDA C can be achieved, the efficiency of program development would be greatly improved. This study designs an algorithm converting Fortran to CUDA C, implements the algorithm through regular expressions and shell scripts, and verifies it by programming test cases. Experimental results show that this tool is reliable, stable, and compatible. In the transplant process of large programs, it can automatically filter and establish variable information tables and generate CUDA-related operation functions. The resulting code possesses good readability, and the conversion accuracy is more than 80%. The workload of the transplant is effectively reduced.
文章编号:     中图分类号:    文献标志码:
基金项目:国家重点研发计划(2016YFB0200800); 国家自然科学重点基金(41931183); 国家重大科技基础设施项目“地球系统数值模拟装置”
引用文本:
刘颖辉,迟学斌,姜金荣,张峰.一种Fortran到CUDA C的转换方法.计算机系统应用,2022,31(5):351-357
LIU Ying-Hui,CHI Xue-Bin,JIANG Jin-Rong,ZHANG Feng.Conversion Method from Fortran to CUDA C.COMPUTER SYSTEMS APPLICATIONS,2022,31(5):351-357