1/*===- TableGen'erated file -------------------------------------*- C++ -*-===*\
2|* *|
3|* Dialect Declarations *|
4|* *|
5|* Automatically generated file, do not edit! *|
6|* *|
7\*===----------------------------------------------------------------------===*/
8
9namespace mlir {
10namespace tfg {
11
12class TFGraphDialect : public ::mlir::Dialect {
13 explicit TFGraphDialect(::mlir::MLIRContext *context);
14
15 void initialize();
16 friend class ::mlir::MLIRContext;
17public:
18 ~TFGraphDialect() override;
19 static constexpr ::llvm::StringLiteral getDialectNamespace() {
20 return ::llvm::StringLiteral("tfg");
21 }
22
23 /// Parse an attribute registered to this dialect.
24 ::mlir::Attribute parseAttribute(::mlir::DialectAsmParser &parser,
25 ::mlir::Type type) const override;
26
27 /// Print an attribute registered to this dialect.
28 void printAttribute(::mlir::Attribute attr,
29 ::mlir::DialectAsmPrinter &os) const override;
30
31 /// Provides a hook for op interface.
32 void *getRegisteredInterfaceForOp(mlir::TypeID interfaceID,
33 mlir::OperationName opName) override;
34
35 StringAttr getNameAttrIdentifier() const { return name_key_; }
36 static constexpr StringLiteral getNameAttrKey() { return {"_mlir_name"}; }
37
38 StringAttr getDeviceAttrIdentifier() const { return device_key_; }
39 static constexpr StringLiteral getDeviceAttrKey() {
40 return {"_mlir_device"};
41 }
42
43 StringAttr getAssignedDeviceAttrIdentifier() const {
44 return assigned_device_key_;
45 }
46 static constexpr StringLiteral getAssignedDeviceAttrKey() {
47 return {"_mlir_assigned_device"};
48 }
49
50 StringAttr getFullTypeAttrIdentifier() const { return fulltype_key_; }
51 static constexpr StringLiteral getFullTypeAttrKey() {
52 return {"_mlir_fulltype"};
53 }
54
55 StringAttr getTfgNameAttrIdentifier() const { return tfg_name_key_; }
56 static constexpr StringRef getTfgNameAttrKey() { return "tfg.name"; }
57
58 StringAttr getTfgDescriptionAttrIdentifier() const {
59 return tfg_description_key_;
60 }
61 static constexpr StringRef getTfgDescriptionAttrKey() {
62 return {"tfg.description"};
63 }
64
65 StringAttr getTfgIsRefAttrIdentifier() const { return tfg_is_ref_key_; }
66 static constexpr StringRef getTfgIsRefAttrKey() { return {"tfg.is_ref"}; }
67
68 StringAttr getTfgHandleDataAttrIdentifier() const {
69 return tfg_handle_data_key_;
70 }
71 static constexpr StringRef getTfgHandleDataAttrKey() {
72 return {"tfg.handle_data"};
73 }
74
75 StringAttr getTfgFullTypeAttrIdentifier() const {
76 return tfg_full_type_key_;
77 }
78 static constexpr StringRef getTfgFullTypeAttrKey() {
79 return {"tfg.experimental_full_type"};
80 }
81
82 StringAttr getLiftedGraphFuncNameAttrIdentifier() const {
83 return lifted_graph_func_name_;
84 }
85 static constexpr StringRef getLiftedGraphFuncNameKey() {
86 return {"_mlir_lifted_graph"};
87 }
88
89 // Cached accessor for the control type.
90 ControlType getControlType() const { return control_ty_; }
91
92 // Print an operation that belongs to this dialect if unregistered.
93 void printCustomTfOp(Operation *op, OpAsmPrinter &printer) const;
94
95 // Returns the hook to parse an operation belonging to this dialect, even
96 // if unregistered.
97 Optional<ParseOpHook> getParseOperationHook(StringRef opName) const
98 override;
99
100 // Returns the took to print an operation belonging to this dialect, even
101 // if unregistered.
102 llvm::unique_function<void(Operation *, OpAsmPrinter &)>
103 getOperationPrinter(Operation *op) const override;
104
105 // Functions for checking operation categories.
106 #define GET_OP_CATEGORIES
107 #include "tensorflow/core/ir/tf_op_names.inc"
108
109 private:
110 // Fallback implementation of OpAsmOpInterface.
111 TFGraphOpAsmInterface *fallbackOpAsmInterface_ = nullptr;
112
113 // Cached TensorFlow operation names.
114 #define GET_OP_NAME_DECLS
115 #include "tensorflow/core/ir/tf_op_names.inc"
116
117 // Cached identifier for efficiency purpose.
118 StringAttr assigned_device_key_;
119 StringAttr device_key_;
120 StringAttr fulltype_key_;
121 StringAttr lifted_graph_func_name_;
122 StringAttr name_key_;
123 StringAttr tfg_description_key_;
124 StringAttr tfg_full_type_key_;
125 StringAttr tfg_handle_data_key_;
126 StringAttr tfg_is_ref_key_;
127 StringAttr tfg_name_key_;
128
129 // Cached control type.
130 ControlType control_ty_;
131 };
132} // namespace tfg
133} // namespace mlir
134MLIR_DECLARE_EXPLICIT_TYPE_ID(::mlir::tfg::TFGraphDialect)
135