[mlir][spirv] Change default subgroup size
authorLei Zhang <antiagainst@google.com>
Fri, 10 Dec 2021 18:58:02 +0000 (13:58 -0500)
committerLei Zhang <antiagainst@google.com>
Sat, 11 Dec 2021 00:20:49 +0000 (19:20 -0500)
This should really come from a matching target environment. But
as a default, it can be handy (to avoid always listing the full
resource limits attribute in IR, etc.). It's common to see 32
so use that as the subgroup size.

Reviewed By: scotttodd

Differential Revision: https://reviews.llvm.org/D115534

mlir/include/mlir/Dialect/SPIRV/IR/TargetAndABI.td

index f9a6600..22fd542 100644 (file)
@@ -78,8 +78,7 @@ def SPV_ResourceLimitsAttr : StructAttr<"ResourceLimitsAttr", SPIRV_Dialect, [
                     DefaultValuedAttr<I32ElementsAttr, "{128, 128, 64}">>,
 
     // The default number of invocations in each subgroup.
-    // 0x7FFFFFFF means unknown.
-    StructFieldAttr<"subgroup_size", DefaultValuedAttr<I32Attr, "0x7FFFFFFF">>,
+    StructFieldAttr<"subgroup_size", DefaultValuedAttr<I32Attr, "32">>,
 
     // The configurations of cooperative matrix operations
     // supported. Default is an empty list.