LLVM Makes Progress On Using ClangIR To Compile GPU Kernels
ClangIR is a new IR for LLVM's Clang compiler built atop MLIR. Thanks to this year's Google Summer of Code, there has been progress on being able to compile GPU kernels using ClangIR as another improvement for heterogeneous programming with this open-source compiler stack.
Student developer Zhi Ma took to the effort of enabling GPU kernel support with ClangIR over the summer. The project was centered around enabling OpenCL C language support in ClangIR that can then be targeted to SPIR-V for executing atop OpenCL/Vulkan drivers. This ultimately aims to further improve LLVM's support around SYCL and NVIDIA CUDA too.
GSoC 2024 led to working on address space support in ClangIR, OpenCL language and SPIR-V target integration, adding vector type support, kernel and module metadata emission, and more.
This project for GPU kernel support in ClangIR was a success and has been summed up on the LLVM blog. The main takeaway from the project is:
Those wishing to learn more about ClangIR can do so via GitHub.
Student developer Zhi Ma took to the effort of enabling GPU kernel support with ClangIR over the summer. The project was centered around enabling OpenCL C language support in ClangIR that can then be targeted to SPIR-V for executing atop OpenCL/Vulkan drivers. This ultimately aims to further improve LLVM's support around SYCL and NVIDIA CUDA too.
GSoC 2024 led to working on address space support in ClangIR, OpenCL language and SPIR-V target integration, adding vector type support, kernel and module metadata emission, and more.
This project for GPU kernel support in ClangIR was a success and has been summed up on the LLVM blog. The main takeaway from the project is:
"The project successfully met its primary goals. OpenCL kernels from the Polybench-GPU benchmark suite can now be compiled using ClangIR into LLVM IR for SPIR-V. All patches have been merged into the main ClangIR repository, and the project’s progress has been well-documented in the overview issue. I believe the work not only advanced OpenCL support but also laid a solid foundation for future enhancements, such as SYCL and CUDA support in ClangIR.
We have successfully compiled and executed all 20 OpenCL C benchmarks from the polybenchGpu repository, passing the built-in result validation."
Those wishing to learn more about ClangIR can do so via GitHub.
2 Comments