31 lines · plain
1// 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 %s2 3module attributes {4 gpu.container_module,5 spirv.target_env = #spirv.target_env<#spirv.vce<v1.0, [Shader], []>, #spirv.resource_limits<>>6} {7 // CHECK-LABEL: func.func @main8 // CHECK: %[[C1:.*]] = arith.constant 1 : index9 // CHECK: gpu.launch_func @[[$KERNELS_1:.*]]::@[[$BUILTIN_WG_ID_X:.*]] blocks in (%[[C1]], %[[C1]], %[[C1]]) threads in (%[[C1]], %[[C1]], %[[C1]])10 func.func @main() {11 %c1 = arith.constant 1 : index12 gpu.launch_func @kernels_1::@builtin_workgroup_id_x13 blocks in (%c1, %c1, %c1) threads in (%c1, %c1, %c1)14 return15 }16 17 // CHECK: gpu.module @[[$KERNELS_1]]18 // CHECK: spirv.module @{{.*}} Logical GLSL45019 // CHECK: spirv.func @[[$BUILTIN_WG_ID_X]]20 // CHECK: spirv.mlir.addressof21 // CHECK: spirv.Load "Input"22 // CHECK: spirv.CompositeExtract23 gpu.module @kernels_1 {24 gpu.func @builtin_workgroup_id_x() kernel25 attributes {spirv.entry_point_abi = #spirv.entry_point_abi<workgroup_size = [16, 1, 1]>} {26 %0 = gpu.block_id x27 gpu.return28 }29 }30}31