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工具包,该框架能够自动生成Java可组合函数库,用于动态构建SPIR-V二进制模块。优化编译器与运行时系统可利用Beehive SPIR-V工具包,从托管运行时系统(如Java虚拟机JVM)生成并验证SPIR-V二进制模块。此外,本框架架构设计支持以易维护的方式适配SPIR-V新版本发布,并便于自动生成除SPIR-V之外其他标准的Java库。Beehive SPIR-V工具包还包含汇编器(从反汇编的SPIR-V文本文件生成二进制模块)、反汇编器(将SPIR-V二进制代码转换为文本文件)及控制台客户端应用。据我们所知,Beehive SPIR-V工具包是首个能够动态生成SPIR-V二进制模块的Java编程框架。为展示框架应用,我们演示了SPIR-V Beehive工具包在TornadoVM中的集成——TornadoVM是一个在异构硬件上自动卸载并运行Java程序的Java框架。实验表明,通过SPIR-V Beehive工具包,TornadoVM的代码编译速度比其现有的OpenCL C JIT编译器快3倍,且相比TornadoVM中原有的OpenCL C后端,其执行性能最高提升1.52倍。