[Mlir-commits] [mlir] [mlir][xegpu] Add definition of SliceAttr (PR #150146)
Charitha Saumya
llvmlistbot at llvm.org
Tue Aug 5 12:59:27 PDT 2025
================
@@ -175,7 +175,34 @@ def XeGPU_FenceScopeAttr:
let assemblyFormat = "$value";
}
-def XeGPU_LayoutAttr : XeGPUAttr<"Layout", "layout"> {
+def LayoutTrait: AttrInterface<"LayoutTrait"> {
+ let cppNamespace = "::mlir::xegpu";
+ let description = [{
+ Common trait for all XeGPU layouts.
+ }];
+
+ let methods = [
+ InterfaceMethod<"Get the rank of attribute",
+ "int64_t",
+ "getRank">,
+ InterfaceMethod<"Get the effective sg layout",
+ "std::optional<SmallVector<int64_t>>",
+ "getEffectiveSgLayout">,
+ InterfaceMethod<"Get the effective sg data",
+ "std::optional<SmallVector<int64_t>>",
+ "getEffectiveSgData">,
+ InterfaceMethod<"Delinearize the Subgroup Id",
+ "FailureOr<SmallVector<Value>>",
+ "delinearizeSubgroupId",
+ (ins "OpBuilder &": $builder, "Location":$loc, "Value":$linearId)>,
+ InterfaceMethod<"Get the local offset to be accessed by the given subgroup Id",
+ "FailureOr<SmallVector<SmallVector<Value>>>",
----------------
charithaintc wrote:
what is the need for having a vector<vector<>> here?
https://github.com/llvm/llvm-project/pull/150146
More information about the Mlir-commits
mailing list