tvm
tir_pattern.h
Go to the documentation of this file.
1 /*
2  * Licensed to the Apache Software Foundation (ASF) under one
3  * or more contributor license agreements. See the NOTICE file
4  * distributed with this work for additional information
5  * regarding copyright ownership. The ASF licenses this file
6  * to you under the Apache License, Version 2.0 (the
7  * "License"); you may not use this file except in compliance
8  * with the License. You may obtain a copy of the License at
9  *
10  * http://www.apache.org/licenses/LICENSE-2.0
11  *
12  * Unless required by applicable law or agreed to in writing,
13  * software distributed under the License is distributed on an
14  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15  * KIND, either express or implied. See the License for the
16  * specific language governing permissions and limitations
17  * under the License.
18  */
19 
25 #ifndef TVM_RELAX_TIR_PATTERN_H_
26 #define TVM_RELAX_TIR_PATTERN_H_
27 
28 #include <tvm/tir/function.h>
29 
30 namespace tvm {
31 namespace relax {
32 
34 
35 /*
36  * \brief The match result of a TIR pattern.
37  */
38 class MatchResultNode : public Object {
39  public:
47  v->Visit("pattern", &pattern);
48  v->Visit("symbol_values", &symbol_values);
49  v->Visit("matched_buffers", &matched_buffers);
50  }
51  static constexpr const char* _type_key = "relax.MatchResult";
53 };
54 
58 class MatchResult : public ObjectRef {
59  public:
66  TVM_DLL explicit MatchResult(TIRPattern pattern, Array<PrimExpr> symbol_values,
67  Array<tir::Buffer> matched_buffers);
68 
70 };
71 
73 } // namespace relax
74 } // namespace tvm
75 #endif // TVM_RELAX_TIR_PATTERN_H_
Visitor class to get the attributes of an AST/IR node. The content is going to be called for each fie...
Definition: reflection.h:52
Definition: tir_pattern.h:38
static constexpr const char * _type_key
Definition: tir_pattern.h:51
TIRPattern pattern
Definition: tir_pattern.h:41
TVM_DECLARE_FINAL_OBJECT_INFO(MatchResultNode, Object)
Array< PrimExpr > symbol_values
The evaluated values of symbolic vars.
Definition: tir_pattern.h:43
void VisitAttrs(AttrVisitor *v)
Definition: tir_pattern.h:46
Array< tir::Buffer > matched_buffers
The matched buffers of input and output.
Definition: tir_pattern.h:45
Managed reference to MatchResultNode.
Definition: tir_pattern.h:58
MatchResult(TIRPattern pattern, Array< PrimExpr > symbol_values, Array< tir::Buffer > matched_buffers)
Constructor.
Array, container representing a contiguous sequence of ObjectRefs.
Definition: array.h:289
Base class of all object reference.
Definition: object.h:519
base class of all object containers.
Definition: object.h:171
Please refer to TypedPackedFunc<R(Args..)>.
Definition: packed_func.h:63
Managed reference to PrimFuncNode.
Definition: function.h:145
PrimFuncFrame PrimFunc(bool is_private)
The primitive function statement.
runtime implementation for LibTorch/TorchScript.
Definition: analyzer.h:36
#define TVM_DEFINE_OBJECT_REF_METHODS(TypeName, ParentType, ObjectName)
Definition: object.h:758
TIR Function.