Initial implementation to translate kernel fn in GPU Dialect to SPIR-V Dialect
authorMahesh Ravishankar <ravishankarm@google.com>
Tue, 30 Jul 2019 18:29:48 +0000 (11:29 -0700)
committerA. Unique TensorFlower <gardener@tensorflow.org>
Tue, 30 Jul 2019 18:55:55 +0000 (11:55 -0700)
commitea56025f1e965e3dd30ddcb41779dcee8b1b4117
tree11ae5ee6c841cb9f2186078bc4174bff27f36f4d
parent4a55bd5f28e64a0c134adfbbcc20e3ea3af937c6
Initial implementation to translate kernel fn in GPU Dialect to SPIR-V Dialect

This CL adds an initial implementation for translation of kernel
function in GPU Dialect (used with a gpu.launch_kernel) op to a
spv.Module. The original function is translated into an entry
function.
Most of the heavy lifting is done by adding TypeConversion and other
utility functions/classes that provide most of the functionality to
translate from Standard Dialect to SPIR-V Dialect. These are intended
to be reusable in implementation of different dialect conversion
pipelines.
Note : Some of the files for have been renamed to be consistent with
the norm used by the other Conversion frameworks.
PiperOrigin-RevId: 260759165
20 files changed:
mlir/include/mlir/Conversion/StandardToSPIRV/ConvertStandardToSPIRV.h [new file with mode: 0644]
mlir/include/mlir/Conversion/StandardToSPIRV/StdOpsToSPIRVConversion.h [deleted file]
mlir/include/mlir/Dialect/SPIRV/Passes.h
mlir/include/mlir/Dialect/SPIRV/SPIRVDialect.h
mlir/include/mlir/Dialect/SPIRV/SPIRVOps.h
mlir/include/mlir/Dialect/SPIRV/SPIRVStructureOps.td
mlir/lib/Conversion/CMakeLists.txt
mlir/lib/Conversion/GPUToSPIRV/CMakeLists.txt [new file with mode: 0644]
mlir/lib/Conversion/GPUToSPIRV/GPUToSPIRV.cpp [new file with mode: 0644]
mlir/lib/Conversion/StandardToSPIRV/CMakeLists.txt
mlir/lib/Conversion/StandardToSPIRV/ConvertStandardToSPIRV.cpp [new file with mode: 0644]
mlir/lib/Conversion/StandardToSPIRV/ConvertStandardToSPIRVPass.cpp [new file with mode: 0644]
mlir/lib/Conversion/StandardToSPIRV/StandardToSPIRV.td [moved from mlir/lib/Conversion/StandardToSPIRV/StdOpsToSPIRVConversion.td with 84% similarity]
mlir/lib/Conversion/StandardToSPIRV/StdOpsToSPIRVConversion.cpp [deleted file]
mlir/lib/Dialect/SPIRV/SPIRVDialect.cpp
mlir/lib/Dialect/SPIRV/SPIRVOps.cpp
mlir/test/Conversion/GPUToSPIRV/simple.mlir [new file with mode: 0644]
mlir/test/Dialect/SPIRV/ops.mlir
mlir/test/Dialect/SPIRV/standard_ops_to_spirv.mlir
mlir/tools/mlir-tblgen/SPIRVUtilsGen.cpp