With the removal of mlir-vulkan-runner (as part of #73457) ine7e3c45bc7, this pass no longer has to be public (previously it had to be so the runner could use it). This commit makes it instead only available for use by mlir-opt. This is a recommit of058d183980(#124301) which had been reverted in4573c857dadue to a missing linker dependency on MLIRSPIRVTransforms in mlir/test/lib/Pass/CMakeLists.txt (fixed in this commit).
31 lines
1.2 KiB
MLIR
31 lines
1.2 KiB
MLIR
// RUN: mlir-opt -test-convert-to-spirv="convert-gpu-modules=true nest-in-gpu-module=true run-signature-conversion=false run-vector-unrolling=false" %s | FileCheck %s
|
|
|
|
module attributes {
|
|
gpu.container_module,
|
|
spirv.target_env = #spirv.target_env<#spirv.vce<v1.0, [Shader], []>, #spirv.resource_limits<>>
|
|
} {
|
|
// CHECK-LABEL: func.func @main
|
|
// CHECK: %[[C1:.*]] = arith.constant 1 : index
|
|
// CHECK: gpu.launch_func @[[$KERNELS_1:.*]]::@[[$BUILTIN_WG_ID_X:.*]] blocks in (%[[C1]], %[[C1]], %[[C1]]) threads in (%[[C1]], %[[C1]], %[[C1]])
|
|
func.func @main() {
|
|
%c1 = arith.constant 1 : index
|
|
gpu.launch_func @kernels_1::@builtin_workgroup_id_x
|
|
blocks in (%c1, %c1, %c1) threads in (%c1, %c1, %c1)
|
|
return
|
|
}
|
|
|
|
// CHECK: gpu.module @[[$KERNELS_1]]
|
|
// CHECK: spirv.module @{{.*}} Logical GLSL450
|
|
// CHECK: spirv.func @[[$BUILTIN_WG_ID_X]]
|
|
// CHECK: spirv.mlir.addressof
|
|
// CHECK: spirv.Load "Input"
|
|
// CHECK: spirv.CompositeExtract
|
|
gpu.module @kernels_1 {
|
|
gpu.func @builtin_workgroup_id_x() kernel
|
|
attributes {spirv.entry_point_abi = #spirv.entry_point_abi<workgroup_size = [16, 1, 1]>} {
|
|
%0 = gpu.block_id x
|
|
gpu.return
|
|
}
|
|
}
|
|
}
|