HomePhabricator

[mlir][gpu][mlir-cuda-runner] Refactor ConvertKernelFuncToCubin to be generic.

Authored by whchung on May 22 2020, 2:25 PM.

Description

[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