1/*===- TableGen'erated file -------------------------------------*- C++ -*-===*\
2|* *|
3|* AttrDef Declarations *|
4|* *|
5|* Automatically generated file, do not edit! *|
6|* *|
7\*===----------------------------------------------------------------------===*/
8
9#ifdef GET_ATTRDEF_CLASSES
10#undef GET_ATTRDEF_CLASSES
11
12#include "mlir/IR/Attributes.h"
13
14
15namespace mlir {
16class AsmParser;
17class AsmPrinter;
18} // namespace mlir
19namespace mlir::shard {
20
21/// Reduction of an iterator/grid dimension.
22class ReductionKindAttr;
23class GridAxesArrayAttr;
24namespace detail {
25
26struct ReductionKindAttrStorage;
27
28} // namespace detail
29class ReductionKindAttr : public ::mlir::Attribute::AttrBase<ReductionKindAttr, ::mlir::Attribute, detail::ReductionKindAttrStorage> {
30public:
31 using Base::Base;
32 static constexpr ::llvm::StringLiteral name = "shard.partial";
33 static constexpr ::llvm::StringLiteral dialectName = "shard";
34 static ReductionKindAttr get(::mlir::MLIRContext *context, ::mlir::shard::ReductionKind value);
35 static constexpr ::llvm::StringLiteral getMnemonic() {
36 return {"partial"};
37 }
38
39 static ::mlir::Attribute parse(::mlir::AsmParser &odsParser, ::mlir::Type odsType);
40 void print(::mlir::AsmPrinter &odsPrinter) const;
41 ::mlir::shard::ReductionKind getValue() const;
42};
43namespace detail {
44
45struct GridAxesArrayAttrStorage;
46
47} // namespace detail
48class GridAxesArrayAttr : public ::mlir::Attribute::AttrBase<GridAxesArrayAttr, ::mlir::Attribute, detail::GridAxesArrayAttrStorage> {
49public:
50 using Base::Base;
51 size_t size() const { return getAxes().size(); }
52 auto begin() const { return getAxes().begin(); }
53 auto end() const { return getAxes().end(); }
54 static constexpr ::llvm::StringLiteral name = "shard.axisarray";
55 static constexpr ::llvm::StringLiteral dialectName = "shard";
56 static GridAxesArrayAttr get(::mlir::MLIRContext *context, ::llvm::ArrayRef<GridAxesAttr> axes);
57 static constexpr ::llvm::StringLiteral getMnemonic() {
58 return {"axisarray"};
59 }
60
61 static ::mlir::Attribute parse(::mlir::AsmParser &odsParser, ::mlir::Type odsType);
62 void print(::mlir::AsmPrinter &odsPrinter) const;
63 ::llvm::ArrayRef<GridAxesAttr> getAxes() const;
64};
65
66} // namespace mlir::shard
67MLIR_DECLARE_EXPLICIT_TYPE_ID(::mlir::shard::ReductionKindAttr)
68MLIR_DECLARE_EXPLICIT_TYPE_ID(::mlir::shard::GridAxesArrayAttr)
69
70#endif // GET_ATTRDEF_CLASSES
71
72