LLVM Adds A SPIR-V CPU Runner For Handling GPU Kernels On The CPU
LLVM has merged an experimental MLIR-based SPIR-V CPU runner that the developers are working towards being able to handle CPU-based execution of GPU kernels.
This new SPIR-V runner is built around the MLIR intermediate representation (Multi-Level Intermediate Representation) with a focus of going from GPU-focused code translated through SPIR-V and to LLVM and then executed on the CPU. The runner focus is similar to that of the MLIR-based runners for NVIDIA CUDA, AMD ROCm, and Vulkan, but just executing on the CPU itself. It was earlier this year LLVM added the MLIR-Vulkan-Runner for handling MLIR on Vulkan hardware.
More details on this new CPU runner for SPIR-V via this commit that landed in LLVM 12 mainline.
It will be interesting to watch this runner mature and hopefully allowing for easier and robust SPIR-V kernel fallbacks to CPU-based execution when needed or for verification purposes outside of the GPU.