领域编程语言SIMC到SIMD的代码转换技术
发布时间:2018-02-02 09:53
本文关键词: clang SIMD 代码转换 领域编程语言 编译工具 出处:《吉林大学》2017年硕士论文 论文类型:学位论文
【摘要】:随着现代社会的计算机技术高速发展,对计算机高性能计算能力也提出了更高的需求,尤其在特定的多媒体图像与无线通讯领域的研发场景中,需要大量密集型的数据运算操作,传统数据串行处理方法难以达到理想效果,在CPU物理性能达到瓶颈的情况下,CPU的主流处理方法则是进行SIMD(单指令多数据)操作,其使用SIMD寄存器完成数据并行处理来取得加速收益。同时,随着编译器技术的不断发展,领域专家提出并实现了通过相关编译器自动生成高性能代码的解决方案,因此,完整的SIMD代码自动化转换技术在程序生产环境中存在实际意义,其可以缩短研发周期,降低人力成本,同时保证SIMD程序的准确性并进行相关程序优化。本文中和特定领域算法特征,基于clang编译器扩展了一套自定义高层语言SIMC到SIMD程序自动转换工具。其中SIMC是一种面向图像与无线通讯领域扩展的类C程序语言,SIMC进行了一些语言扩展,例如加入矩阵、向量、复数等关键字,其能够完整描述应用特征;同时还扩展了对算子表达式的描述(如矩阵卷积、矩阵和运算表达式)。作为编译器输入语言SIMC可以提升开发效率,降低程序优化成本与算法复杂度。经过编译之后,可自动生成针对特定硬件平台的SIMD程序。SIMC到SIMD的编译转换工具主要工作集中在clang编译器的扩展开发,在编译器的词法、语法、语义分析过程中,本文通过对SIMC程序的特定关键字和算子表达式进行并行性分析,在中间表示AST上进行针对特殊表达式的节点变换,其为代码转换工具的核心工作。其中具体实现设计可分为对特定表达式的扩展及其转换接口设计,变量基础信息收集,循环迭代区间并行性分析,调用SIMD内置函数接口设计,本论文框架分别介绍了SIMC语言设计说明及其算法特征,SIMD操作原理,clang编译器及其扩展原理,代码并行性分析及其实现模块设计。最后一步,对特定算法的SIMC程序自动转换生成的SIMD代码进行正确性与性能验证,通过对比其程序性能与专家手工优化版本相一致,最终测试数据表明,在X86平台上SIMC-SIMD编译转换工具可以将程序时间运行效率较之串行语言提高3.85-6.59倍。
[Abstract]:With the rapid development of computer technology in modern society, there is a higher demand for high performance computing power of computer, especially in the research and development of specific multimedia image and wireless communication field. A large number of intensive data operations are required, so the traditional method of serial data processing is difficult to achieve ideal results. When the physical performance of CPU reaches the bottleneck, the mainstream processing method of CPU is to carry out single instruction multi-data operation. At the same time, with the continuous development of compiler technology, domain experts have proposed and implemented a solution to automatically generate high-performance code through related compilers. The complete SIMD code automation technology has practical significance in the program production environment, it can shorten the research and development cycle, reduce the labor cost, At the same time to ensure the accuracy of the SIMD program and related program optimization. Based on the clang compiler, this paper extends a set of automatic conversion tools from SIMC to SIMD program. SIMC is a C-like programming language for image and wireless communication, which extends some languages, such as adding matrix, vector, etc. It also extends the description of operator expressions (such as matrix convolution, matrix and operation expression). As a compiler input language, SIMC can improve the development efficiency. To reduce the cost of program optimization and algorithm complexity. After compiling, can automatically generate specific hardware platform specific SIMD program SIMC to SIMD compiler conversion tools mainly focus on the expansion of the clang compiler development, in the compiler lexical, syntax, In the process of semantic analysis, this paper analyzes the parallelism of the special keywords and operator expressions of SIMC programs, and transforms the nodes of special expressions on the intermediate representation AST. It is the core work of the code conversion tool, in which the concrete implementation design can be divided into the extension of a specific expression and its conversion interface design, variable basic information collection, cycle iteration interval parallelism analysis, calling SIMD built-in function interface design. The framework of this paper introduces the SIMC language design description and its algorithm characteristic, the principle of SIMD operation and its extension principle, the code parallelism analysis and its implementation module design. The correctness and performance of the SIMD code generated by the automatic transformation of the SIMC program of the specific algorithm are verified. The program performance is consistent with that of the expert manual optimization version. The final test data show that, On the X86 platform, the SIMC-SIMD compiler and conversion tool can improve the program time efficiency by 3.85-6.59 times compared with the serial language.
【学位授予单位】:吉林大学
【学位级别】:硕士
【学位授予年份】:2017
【分类号】:TP314
【参考文献】
相关期刊论文 前4条
1 徐颖;李春江;董钰山;周思齐;;GCC编译器中编译指导的自动向量化实现[J];计算机科学;2014年S2期
2 刘颖;吕方;王蕾;陈莉;崔慧敏;冯晓兵;;异构并行编程模型研究与进展[J];软件学报;2014年07期
3 李春江;黄娟娟;徐颖;杜云飞;陈娟;;典型编译器自动向量化效果评估与分析[J];计算机科学;2013年04期
4 姚远;赵荣彩;;基于编译指示的向量化方法[J];计算机工程;2012年12期
,本文编号:1484234
本文链接:https://www.wllwen.com/kejilunwen/ruanjiangongchenglunwen/1484234.html