• 中国计算机学会会刊
  • 中国科技核心期刊
  • 中文核心期刊

计算机工程与科学 ›› 2021, Vol. 43 ›› Issue (06): 997-1005.

• 高性能计算 • 上一篇    下一篇

一种基于国产异构众核处理器的C++智能源码转换框架

俞茂学1,贾东宁1,2,魏志强1,2,许佳立1,马广浩1   

  1. (1.青岛海洋科学与技术试点国家实验室,山东 青岛 266237;2.中国海洋大学信息科学与工程学院,山东 青岛 266100)

  • 收稿日期:2020-08-24 修回日期:2021-03-12 接受日期:2021-06-25 出版日期:2021-06-25 发布日期:2021-06-22
  • 基金资助:
    山东省重大科研平台建设项目(2018SDPT01)

An intelligent C++ translator architecture for many-core processors

YU Mao-xue1,JIA Dong-ning1,2,WEI Zhi-qiang1,2,XU Jia-li1,MA Guang-hao1   

  1. (1.Pilot National Laboratory for Marine Science Technology,Qingdao 266237;

    2.College of Information Science and Engineering,Ocean University of China,Qingdao 266100,China)


  • Received:2020-08-24 Revised:2021-03-12 Accepted:2021-06-25 Online:2021-06-25 Published:2021-06-22

摘要: 国产异构众核处理器是我国打破国际技术壁垒,在高性能计算领域取得突破的关键环节。围绕国产超算的软件生态环境建设,采用智能源码转换的方法盘活海量多核架构的遗产代码是加速软件研发效率,推动领域发展的重要途径。针对国产运算核心不支持C++编译的现状,基于开源的ANTLR语言翻译工具,提出了一种面向异构众核处理器的智能化C++语言向C语言转换的辅助框架。该框架聚焦面向对象语言的关键特征,基于抽象语法树,实现了基类和继承类、函数定义、基于标签法的模板实例化以及部分STL库的C语言转换,建立了待转换代码的自动化标注体系,极大地提高了C++代码的转换和移植效率。通过对可衡量的并行计算基准应用BableStream进行自动转换和移植测试,证实了该转换框架的有效性。


关键词: 异构众核, 源码转换, OpenACC, 并行计算, ANTLR, C++

Abstract: Domestic heterogeneous many-core processors are a key link for my country to break international technical barriers and make breakthroughs in the field of high-performance computing. Focusing on the construction of domestically produced super-computing software ecological environment, using the intelligent source code conversion method to revitalize the massive multi-core architecture legacy code is an important way to accelerate the efficiency of software development and promote the development of the field. Aiming at the current situation that domestic computing cores do not support C++ compilation, based on the open source ANTLR language translation tool, this paper proposes an auxiliary framework of the intelligent C++ to C conversion for heterogeneous many-core processors.The framework focuses on the key features of object-oriented languages. Based on the abstract syntax tree, it implements base classes and inheritance classes, function definitions, template instantiation based on tagging, and C language conversion of some STL libraries, and establishes automatic annotation of the code to be converted. The system greatly improves the conversion and transplantation efficiency of C++ code. The automatic conversion and transplantation test of the measurable parallel computing benchmark application BableStream confirms the effectiveness of the conversion method proposed in this paper.



Key words: heterogeneous many-core, source code translator, OpenACC, parallel computing, ANTLR, C++