arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2208.00607cs.PL
收藏

ShenWei通用C/C ++的设计与实现

Design and Implementation of ShenWei Universal C/C++

Huanqi Cao, Jiajie Chen

摘要:

为多台尖端超级计算机提供动力的神威众核系列处理器配备了其独特的片上异构架构。长期以来,它们要求程序员为管理处理元素(MPE)上的控制部分和计算处理元素(CPE)上的加速部分编写单独的代码,这类似于OpenCL等开放标准。这样的编程模型会导致代码破碎和可维护性差,并且还使得很难将现有项目迁移到商用处理器。借鉴CUDA和DPC++的经验,利用神威众核架构上独特的统一主存,提出了神威通用C/C++(SWUC),它是对C/C++的一种语言扩展,可以实现跨越MPE和CPE边界的流畅编程。通过使用几个新的属性和编译器指令,用户能够在单个文件中编写在MPE和CPE上运行的代码。在C++的情况下,SWUC进一步支持CPE上的lambda表达式,使代码流更好地匹配逻辑设计成为可能。SWUC还设法使Athread库接口可用,缓解了原始神威用户的学习曲线。这些强大的功能共同确保SWUC简化了在神威众核处理器上的编程和现有C/C++应用程序的迁移。

英文摘要:

The ShenWei many-core series processors powering multiple cutting-edge supercomputers are equipped with their unique on-chip heterogeneous architecture. They have long required programmers to write separate codes for the control part on Management Processing Element (MPE) and accelerated part on Compute Processing Element (CPE), which is similar to open standards like OpenCL. Such a programming model results in shattered code and bad maintainability, and also make it hard to migrate existing projects targeting commodity processors. Borrowing the experience from CUDA and DPC++ and leveraging the unique unified main memory on ShenWei many-core architecture, we propose ShenWei Universal C/C++ (SWUC), a language extension to C/C++ that enables fluent programming acrossing the boundary of MPE and CPE. Through the use of several new attributes and compiler directives, users are able to write codes running on MPE and CPE in a single file. In case of C++, SWUC further support lambda expressions on CPEs, making it possible to have the code flow better matching the logical design. SWUC also manages to make the Athread library interfaces available, easing the learning curve for original ShenWei users. These powerful features together ensures SWUC to simplify the programming on ShenWei many-core processors and migration of existing C/C++ applications.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑