通过增选C++特性支持统一着色器专业化
Supporting Unified Shader Specialization by Co-opting C++ Features
摘要:
现代统一编程模型(如CUDA和SYCL)将主机(CPU)代码和GPU代码合并为相同的程序设计语言、相同的文件和相同的词法范围,但缺乏对GPU代码专门化的充分支持,而GPU代码专门化是实时图形的关键优化。此外,当前用于实现专门化的方法不能转化为统一的环境。在本文中,我们创建了一个统一的着色器编程环境中的C++,提供一流的支持专业化,通过增选C++的属性和虚函数功能,并重新实现它们与替代语义来表达所需的服务。通过吸收现有功能,我们使程序员能够使用熟悉的C++编程技术一起编写主机和GPU代码,同时仍然通过我们的源代码到源代码转换器实现高效生成的C++和HLSL代码。
英文摘要:
Modern unified programming models (such as CUDA and SYCL) that combine host (CPU) code and GPU code into the same programming language, same file, and same lexical scope lack adequate support for GPU code specialization, which is a key optimization in real-time graphics. Furthermore, current methods used to implement specialization do not translate to a unified environment. In this paper, we create a unified shader programming environment in C++ that provides first-class support for specialization by co-opting C++'s attribute and virtual function features and reimplementing them with alternate semantics to express the services required. By co-opting existing features, we enable programmers to use familiar C++ programming techniques to write host and GPU code together, while still achieving efficient generated C++ and HLSL code via our source-to-source translator.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。