Skip to content

Commit 2bc70b6

Browse files
committed
add definition draft of SliceAttr
1 parent e73cb43 commit 2bc70b6

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

mlir/include/mlir/Dialect/XeGPU/IR/XeGPUAttrs.td

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -330,4 +330,25 @@ def XeGPU_LayoutAttr : XeGPUAttr<"Layout", "layout"> {
330330
let genVerifyDecl = 1;
331331
}
332332

333+
334+
def XeGPU_SliceAttr : XeGPUAttr<"Slice", "slice"> {
335+
let summary = [{Describes the data distribution and sharing among subgroups or work-items.}];
336+
337+
let description = [{
338+
Like LayoutAttr, SliceAttr describes data distribution among subgroups or work-items.
339+
However, whereas LayoutAttr requires the data to have the same rank as the attribute,
340+
SliceAttr permits the data to have a lower rank. In this case, compute units in the
341+
specified dimensions share the data, provided that the remaining ranks match the data
342+
rank. SliceAttr is commonly used by operations such as vector.multi_reduction and
343+
vector.broadcast.
344+
}];
345+
346+
let parameters = (ins
347+
"Attribute": $parent,
348+
"DenseI64ArrayAttr": $dims
349+
);
350+
351+
let assemblyFormat = "`<` $parent `,` `dim` `=` $dims `>`";
352+
}
353+
333354
#endif // MLIR_DIALECT_XEGPU_IR_XEGPUATTRS_TD

0 commit comments

Comments
 (0)