计算机科学 ›› 2026, Vol. 53 ›› Issue (6): 145-152.doi: 10.11896/jsjkx.251000117
朱鹏志, 黄春, 沈洁, 陈诚, 徐浩然, 龙标
ZHU Pengzhi, HUANG Chun, SHEN Jie, CHEN Cheng, XU Haoran, LONG Biao
摘要: Fortran 语言在科学与工程计算领域具有广泛应用。然而,通用数字信号处理器(General-Purpose Digital Signal Processor,GPDSP)目前主要使用C语言或汇编语言进行编程,尚不支持 Fortran 语言。针对这一现状,面向 CPU-DSP 异构处理器的 Fortran 编译器实现技术,基于LLVM Flang 编译器框架设计并实现了 Fortran 编译器原型 mtFortran,完成了 Flang 前端移植,并重点解决了 Fortran 程序在异构架构上的编译和运行支持,包括加载执行、语法支持、内建函数实现及输入输出(I/O)系统适配问题。实验结果表明,该 Fortran 编译器成功支持 Fortran 语言商用测试集 U_F90_TS_LITE 中 GUIDE F90 测试集的语法特性,在 176 个测试程序中运行时库已完全支持的测试程序(102 道)全部通过异构编译与加载执行验证,主要类别内建函数的实现率达 79.38%,并可支持典型高性能计算程序的运行(如 NPB-EP 测试程序),实现了 Fortran 程序在 CPU-DSP 异构处理器架构上的基础运行能力,为后续完善标准支持、性能优化及并行化扩展奠定了基础。
中图分类号:
| [1]LI R,WANG Q,LIU J.A heterogeneous parallel algorithm for the Cartesian discrete ordinates for multizone heterogeneous system[J].The Journal of Supercomputing,2025,81(4):593. [2]ADAMS J,BRAINERD W.A little history and aFortran 90summary[J].Computer Standards & Interfaces,1996,18(4):279-289. [3]TIOBE Software BV.TIOBE index-TIOBE[EB/OL].(2025-05-02)[2025-05-10].https://www.tiobe.com/tiobe-index/. [4]CATS G,WOLTERS L.TheHirlam project [meteorology][J].IEEE Computational Science and Engineering,1996,3(4):4-7. [5]HOHENKERKC Y.SOFA and the algorithms for transformations between scales & between systems[M]// Journées Systèmes de Référence Spatio-temporels 2011.2012:21-24. [6]BUSS O,GAITANOS T,GALLMEISTER K,et al.Transport-theoretical description of nuclear reactions[J].Physics Reports,2012,512(1):1-124. [7]BUCEK J,LANGE K D,KISTOWSKI J V.SPEC CPU2017:Next-generation compute benchmark[C]//Companion of the 2018 ACM/SPEC International Conference on Performance Engineering.New York:ACM,2018:41-42. [8]LATTNER C,ADVE V.LLVM:a compilation framework for lifelong program analysis & transformation[C]//International Symposium on Code Generation and Optimization.2004:75-86. [9]RASMUSSEN K,ROUSON D,BONACHEA D.Agile acceleration of LLVM Flang support for Fortran 2018 parallel programming[C]//Proceedings of SC Supercomputing Conference(SC 2022).Dallas,TX:Lawrence Berkeley National Laboratory,2022. [10]YIN S,WANG Q,HAO R,et al.Optimizing irregular-shaped matrix-matrix multiplication on multi-coreDSPs[C]//2022 IEEE International Conference on Cluster Computing(CLUSTER).IEEE Computer Society,2022:451-461. [11]MA S,LIU Z,CHEN S,et al.CoordinatedDMA:Improving the DRAM access efficiency for matrix multiplication[J].IEEE Transactions on Parallel and Distributed Systems,2019,30(10):2148-2164. [12]SHI Y,CHEN Z Y,SUN H Y,et al.Design of Autonomous Software Stack for Phytium Matrix DSP [J].Computer Engineering and Science,2024,46(6):968-976. [13]ZHANG P,FANG J,YANG C,et al.MOCL:an efficientOpenCL implementation for the matrix-2000 architecture[C]//Proceedings of the 15th ACM International Conference on Computing Frontiers(CF'18).New York:ACM,2018:26-35. [14]The Flang Team.FlangFortran standards support-the Flangcompiler [EB/OL].(2025-05-22)[2025-05-22].https://flang.llvm.org/docs/FortranStandardsSupport.html. [15]LLVM Foundation.llvm.org/license.txt[EB/OL].(2025-05-13)[2025-05-13].https://llvm.org/LICENSE.txt. [16]OSMIALOWSKI P.How theFlang frontend works:Introduction to the interior of the open-source Fortran frontend for LLVM[C]//Proceedings of the Fourth Workshop on the LLVM Compiler Infrastructure in HPC(LLVM-HPC'17).New York:ACM,2017. [17]2023 Information technology—Programming languages-FORTRAN:ISO/IEC 1539-1[S].Geneva,Switzerland:International Organization for Standardization,2023. [18]LENZ H J.Review of:Programmer's Guide to Fortran 90,3rd ed[J].Computational Statistics and Data Analysis,1997,25(4):494. [19]COMMUNITY F.Fortran intrinsics-Fortran programminglanguage [EB/OL].(2025-05-13)[2025-05-13].https://fortran-lang.org/learn/intrinsics. [20]NASA.NAS Parallel Benchmarks [EB/OL].(2024-06-18)[2025-05-13].https://www.nas.nasa.gov/software/npb.html. [21]MARTINS E M,FAÉ L G,HOFFMANN R B,et al.NPB-Rust:NAS Parallel Benchmarks in Rust[J].arXiv:2502.15536,2025. |
|
||