OSDN Git Service

[mlir][gpu][mlir-cuda-runner] Refactor ConvertKernelFuncToCubin to be generic.
authorWen-Heng (Jack) Chung <whchung@gmail.com>
Fri, 22 May 2020 21:25:00 +0000 (16:25 -0500)
committerWen-Heng (Jack) Chung <whchung@gmail.com>
Thu, 28 May 2020 14:08:28 +0000 (09:08 -0500)
commit061fb8eb2d9f6ffa05f2b57670c918c477ca7f36
tree26bd7544f240fbbd149bcd0098bbcf545654a323
parentfdaa391e3df3c3a555d933122b0ef85eaf5eb63c
[mlir][gpu][mlir-cuda-runner] Refactor ConvertKernelFuncToCubin to be generic.

Make ConvertKernelFuncToCubin pass to be generic:

- Rename to ConvertKernelFuncToBlob.
- Allow specifying triple, target chip, target features.
- Initializing LLVM backend is supplied by a callback function.
- Lowering process from MLIR module to LLVM module is via another callback.
- Change mlir-cuda-runner to adopt the revised pass.
- Add new tests for lowering to ROCm HSA code object (HSACO).
- Tests for CUDA and ROCm are kept in separate directories.

Differential Revision: https://reviews.llvm.org/D80142
17 files changed:
mlir/CMakeLists.txt
mlir/include/mlir/Conversion/GPUCommon/GPUCommonPass.h
mlir/include/mlir/Conversion/GPUToCUDA/GPUToCUDAPass.h [deleted file]
mlir/include/mlir/InitAllPasses.h
mlir/lib/Conversion/CMakeLists.txt
mlir/lib/Conversion/GPUCommon/CMakeLists.txt
mlir/lib/Conversion/GPUCommon/ConvertKernelFuncToBlob.cpp [new file with mode: 0644]
mlir/lib/Conversion/GPUToCUDA/CMakeLists.txt [deleted file]
mlir/lib/Conversion/GPUToCUDA/ConvertKernelFuncToCubin.cpp [deleted file]
mlir/test/Conversion/GPUToROCm/lit.local.cfg [new file with mode: 0644]
mlir/test/Conversion/GPUToROCm/lower-rocdl-kernel-to-hsaco.mlir [new file with mode: 0644]
mlir/test/lib/Transforms/CMakeLists.txt
mlir/test/lib/Transforms/TestConvertGPUKernelToCubin.cpp
mlir/test/lib/Transforms/TestConvertGPUKernelToHsaco.cpp [new file with mode: 0644]
mlir/test/lit.site.cfg.py.in
mlir/tools/mlir-cuda-runner/mlir-cuda-runner.cpp
mlir/tools/mlir-opt/mlir-opt.cpp