一种Fortran到CUDA C的转换方法
作者:
作者单位:

作者简介:

通讯作者:

中图分类号:

基金项目:

国家重点研发计划(2016YFB0200800); 国家自然科学重点基金(41931183); 国家重大科技基础设施项目“地球系统数值模拟装置”


Conversion Method from Fortran to CUDA C
Author:
Affiliation:

Fund Project:

  • 摘要
  • |
  • 图/表
  • |
  • 访问统计
  • |
  • 参考文献
  • |
  • 相似文献
  • |
  • 引证文献
  • |
  • 增强出版
  • |
  • 文章评论
    摘要:

    基于GPU的异构计算逐渐成为主流计算方法, 但限于科学计算编程的历史发展, 大量的数值计算软件仍以Fortran语言实现. 为了提高计算速度, 大量的软件需要移植为CUDA C, 但人工实现程序移植是一项浩繁的工程. 若能实现从Fortran到CUDA C的自动转换, 可以极大的提高程序开发效率. 本文设计了将Fortran转换为CUDA C的算法, 并基于正则表达式和shell脚本实现了该算法, 编写测试用例进行了验证. 实验表明, 该算法可靠稳定兼容性好, 在大型程序的移植过程中, 能够自动筛选并建立变量信息表, 生成CUDA相关操作函数, 且结果代码可读性较好, 转化正确率达80%以上, 有效减少了移植的工作量.

    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.

    参考文献
    相似文献
    引证文献
引用本文

刘颖辉,迟学斌,姜金荣,张峰.一种Fortran到CUDA C的转换方法.计算机系统应用,2022,31(5):351-357

复制
分享
文章指标
  • 点击次数:
  • 下载次数:
  • HTML阅读次数:
  • 引用次数:
历史
  • 收稿日期:2021-07-09
  • 最后修改日期:2021-08-04
  • 录用日期:
  • 在线发布日期: 2022-04-11
  • 出版日期:
您是第位访问者
版权所有:中国科学院软件研究所 京ICP备05046678号-3
地址:北京海淀区中关村南四街4号 中科院软件园区 7号楼305房间,邮政编码:100190
电话:010-62661041 传真: Email:csa (a) iscas.ac.cn
技术支持:北京勤云科技发展有限公司

京公网安备 11040202500063号