This paper presents the Beehive SPIR-V Toolkit; a framework that can automatically generate a Java composable and functional library for dynamically building SPIR-V binary modules. The Beehive SPIR-V Toolkit can be used by optimizing compilers and runtime systems to generate and validate SPIR-V binary modules from managed runtime systems, such as the Java Virtual Machine (JVM). Furthermore, our framework is architected to accommodate new SPIR-V releases in an easy-to-maintain manner, and it facilitates the automatic generation of Java libraries for other standards, besides SPIR-V. The Beehive SPIR-V Toolkit also includes an assembler that emits SPIR-V binary modules from disassembled SPIR-V text files, and a disassembler that converts the SPIR-V binary code into a text file, and a console client application. To the best of our knowledge, the Beehive SPIR-V Toolkit is the first Java programming framework that can dynamically generate SPIR-V binary modules. To demonstrate the use of our framework, we showcase the integration of the SPIR-V Beehive Toolkit in the context of the TornadoVM, a Java framework for automatically offloading and running Java programs on heterogeneous hardware. We show that, via the SPIR-V Beehive Toolkit, the TornadoVM is able to compile code 3x faster than its existing OpenCL C JIT compiler, and it performs up to 1.52x faster than the existing OpenCL C backend in TornadoVM.
翻译:本文介绍了Beehive SPIR-V工具包,这是一个能够自动生成用于动态构建SPIR-V二进制模块的Java可组合函数式库的框架。优化编译器和运行时系统可利用该工具包,从托管运行时系统(如Java虚拟机,JVM)生成并验证SPIR-V二进制模块。此外,本框架的架构设计可轻松适应新发布的SPIR-V标准,并便于为其他标准(除SPIR-V外)自动生成Java库。Beehive SPIR-V工具包还包含一个汇编器(用于从反汇编的SPIR-V文本文件生成SPIR-V二进制模块)、一个反汇编器(将SPIR-V二进制代码转换为文本文件)以及一个控制台客户端应用程序。据我们所知,Beehive SPIR-V工具包是首个能够动态生成SPIR-V二进制模块的Java编程框架。为演示该框架的应用,我们展示了SPIR-V Beehive工具包在TornadoVM(一个用于在异构硬件上自动卸载并运行Java程序的Java框架)中的集成情况。结果表明,通过SPIR-V Beehive工具包,TornadoVM的代码编译速度比其现有的OpenCL C JIT编译器快3倍,性能比TornadoVM中现有的OpenCL C后端快1.52倍。