**For an explanation of these patches see D154153.** Commit message: This pass converts GPU modules into GPU binaries, serializing all targets present in a GPU module by invoking the `serializeToObject` target attribute method. Depends on D154147 Reviewed By: mehdi_amini Differential Revision: https://reviews.llvm.org/D154149
26 lines
988 B
MLIR
26 lines
988 B
MLIR
// REQUIRES: host-supports-nvptx
|
|
// RUN: mlir-opt %s --gpu-module-to-binary="format=llvm" | FileCheck %s
|
|
// RUN: mlir-opt %s --gpu-module-to-binary="format=isa" | FileCheck %s
|
|
|
|
module attributes {gpu.container_module} {
|
|
// CHECK-LABEL:gpu.binary @kernel_module1
|
|
// CHECK:[#gpu.object<#nvvm.target<chip = "sm_70">, "{{.*}}">]
|
|
gpu.module @kernel_module1 [#nvvm.target<chip = "sm_70">] {
|
|
llvm.func @kernel(%arg0: i32, %arg1: !llvm.ptr<f32>,
|
|
%arg2: !llvm.ptr<f32>, %arg3: i64, %arg4: i64,
|
|
%arg5: i64) attributes {gpu.kernel} {
|
|
llvm.return
|
|
}
|
|
}
|
|
|
|
// CHECK-LABEL:gpu.binary @kernel_module2
|
|
// CHECK:[#gpu.object<#nvvm.target<flags = {fast}>, "{{.*}}">, #gpu.object<#nvvm.target, "{{.*}}">]
|
|
gpu.module @kernel_module2 [#nvvm.target<flags = {fast}>, #nvvm.target] {
|
|
llvm.func @kernel(%arg0: i32, %arg1: !llvm.ptr<f32>,
|
|
%arg2: !llvm.ptr<f32>, %arg3: i64, %arg4: i64,
|
|
%arg5: i64) attributes {gpu.kernel} {
|
|
llvm.return
|
|
}
|
|
}
|
|
}
|