[Mlir-commits] [mlir] [mlir][gpu] Update attribute definitions in `gpu::LaunchOp` (PR #152106)
Mehdi Amini
llvmlistbot at llvm.org
Wed Aug 6 07:36:53 PDT 2025
================
@@ -17,6 +17,18 @@ module attributes {gpu.container_module} {
return
}
+ // CHECK-LABEL:func @launch_with_module_func_attr(%{{.*}}: index)
+ func.func @launch_with_module_func_attr(%sz : index) {
+ // CHECK: gpu.launch blocks(%{{.*}}, %{{.*}}, %{{.*}}) in (%{{.*}} = %{{.*}}, %{{.*}} = %{{.*}}, %{{.*}} = %{{.*}}) threads(%{{.*}}, %{{.*}}, %{{.*}}) in (%{{.*}} = %{{.*}}, %{{.*}} = %{{.*}}, %{{.*}} = %{{.*}})
+ gpu.launch blocks(%bx, %by, %bz) in (%grid_x = %sz, %grid_y = %sz, %grid_z = %sz)
+ threads(%tx, %ty, %tz) in (%block_x = %sz, %block_y = %sz, %block_z = %sz) {
+ // CHECK: gpu.terminator
+ gpu.terminator
+ // CHECK: {function = @test_kernel_func, module = @existing_module}
+ } {function = @test_kernel_func, module = @existing_module}
----------------
joker-eph wrote:
The syntax with `{ key = value, ... }` corresponds to the `attr-dict` directive in the declarative assembly. It also exists in the generic printer format and corresponds to the discardable attributes.
However the attributes and properties defined in ODS are not discardable, they are stored separately and not in the discardable attributes dictionary. This should be better reflected in the syntax.
You can actually try `--mlir-print-op-generic` to have a better idea of what I mean.
https://github.com/llvm/llvm-project/pull/152106
More information about the Mlir-commits
mailing list