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.