llvm-project/mlir/tools
George Mitenkov 89808ce734 [MLIR][mlir-spirv-cpu-runner] A SPIR-V cpu runner prototype
This patch introduces a SPIR-V runner. The aim is to run a gpu
kernel on a CPU via GPU -> SPIRV -> LLVM conversions. This is a first
prototype, so more features will be added in due time.

- Overview
The runner follows similar flow as the other runners in-tree. However,
having converted the kernel to SPIR-V, we encode the bind attributes of
global variables that represent kernel arguments. Then SPIR-V module is
converted to LLVM. On the host side, we emulate passing the data to device
by creating in main module globals with the same symbolic name as in kernel
module. These global variables are later linked with ones from the nested
module. We copy data from kernel arguments to globals, call the kernel
function from nested module and then copy the data back.

- Current state
At the moment, the runner is capable of running 2 modules, nested one in
another. The kernel module must contain exactly one kernel function. Also,
the runner supports rank 1 integer memref types as arguments (to be scaled).

- Enhancement of JitRunner and ExecutionEngine
To translate nested modules to LLVM IR, JitRunner and ExecutionEngine were
altered to take an optional (default to `nullptr`) function reference that
is a custom LLVM IR module builder. This allows to customize LLVM IR module
creation from MLIR modules.

Reviewed By: ftynse, mravishankar

Differential Revision: https://reviews.llvm.org/D86108
2020-10-26 09:09:29 -04:00
..
mlir-cpu-runner Add CMake dependency from MLIRJitRunner on all dialects 2020-10-24 01:24:05 +00:00
mlir-cuda-runner Remove global dialect registration 2020-10-24 00:35:55 +00:00
mlir-linalg-ods-gen Remove global dialect registration 2020-10-24 00:35:55 +00:00
mlir-opt Remove global dialect registration 2020-10-24 00:35:55 +00:00
mlir-reduce Remove global dialect registration 2020-10-24 00:35:55 +00:00
mlir-rocm-runner Remove global dialect registration 2020-10-24 00:35:55 +00:00
mlir-shlib [MLIR] Reapply: Adjust libMLIR building to more closely follow libClang 2020-05-04 20:47:57 -07:00
mlir-spirv-cpu-runner [MLIR][mlir-spirv-cpu-runner] A SPIR-V cpu runner prototype 2020-10-26 09:09:29 -04:00
mlir-tblgen [mlir] ODS: support TableGen dag objects to specify OpBuilder parameters 2020-10-21 11:42:50 +02:00
mlir-translate Revert "[RFC] Factor out repetitive cmake patterns for llvm-style projects" 2020-10-04 15:17:34 -07:00
mlir-vulkan-runner Remove global dialect registration 2020-10-24 00:35:55 +00:00
CMakeLists.txt [MLIR][mlir-spirv-cpu-runner] A SPIR-V cpu runner prototype 2020-10-26 09:09:29 -04:00