一种Fortran到CUDA C的转换方法  

Conversion Method from Fortran to CUDA C

在线阅读下载全文

作  者:刘颖辉 迟学斌[1,2] 姜金荣 张峰[1,2] LIU Ying-Hui;CHI Xue-Bin;JIANG Jin-Rong;ZHANG Feng(Computer Network Information Center,Chinese Academy of Sciences,Beijing 100190,China;University of Chinese Academy of Sciences,Beijing 100049,China)

机构地区:[1]中国科学院计算机网络信息中心,北京100190 [2]中国科学院大学,北京100049

出  处:《计算机系统应用》2022年第5期351-357,共7页Computer Systems & Applications

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

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

分 类 号:TP312[自动化与计算机技术—计算机软件与理论]

 

参考文献:

正在载入数据...

 

二级参考文献:

正在载入数据...

 

耦合文献:

正在载入数据...

 

引证文献:

正在载入数据...

 

二级引证文献:

正在载入数据...

 

同被引文献:

正在载入数据...

 

相关期刊文献:

正在载入数据...

相关的主题
相关的作者对象
相关的机构对象