When targeting NVIDIA GPUs, seeing the generated PTX is important. Currently, we don't have simple way to do it.
This work adds dump-ptx to gpu-to-cubin pass. One can use it like `gpu-to-cubin{chip=sm_90 features=+ptx80 dump-ptx}`.
Reviewed By: nicolasvasilache
Differential Revision: https://reviews.llvm.org/D155166
16 lines
411 B
MLIR
16 lines
411 B
MLIR
// RUN: mlir-opt %s \
|
|
// RUN: | mlir-opt -gpu-kernel-outlining \
|
|
// RUN: | mlir-opt -pass-pipeline='builtin.module(gpu.module(strip-debuginfo,convert-gpu-to-nvvm,gpu-to-cubin{dump-ptx}))' \
|
|
// RUN: 2>&1 | FileCheck %s
|
|
|
|
// CHECK: Generated by LLVM NVPTX Back-End
|
|
// CHECK: .visible .func kernel_a()
|
|
// CHECK: ret;
|
|
|
|
gpu.module @bar {
|
|
llvm.func @kernel_a()
|
|
attributes { gpu.kernel } {
|
|
llvm.return
|
|
}
|
|
}
|