tvm
frame.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 #ifndef TVM_SCRIPT_IR_BUILDER_IR_FRAME_H_
20 #define TVM_SCRIPT_IR_BUILDER_IR_FRAME_H_
21 
22 #include <tvm/ir/expr.h>
23 #include <tvm/ir/function.h>
24 #include <tvm/node/node.h>
26 
27 #include <vector>
28 
29 namespace tvm {
30 namespace script {
31 namespace ir_builder {
32 namespace ir {
33 
40  public:
43 
46  v->Visit("global_vars", &global_vars);
47  v->Visit("functions", &functions);
48  }
49 
50  static constexpr const char* _type_key = "script.ir_builder.IRModuleFrame";
52 
53  public:
54  void ExitWithScope() final;
55 };
56 
62 class IRModuleFrame : public IRBuilderFrame {
63  public:
66 };
67 
68 } // namespace ir
69 } // namespace ir_builder
70 } // namespace script
71 } // namespace tvm
72 
73 #endif // TVM_SCRIPT_IR_BUILDER_IR_FRAME_H_
Managed reference to an IRBuilderFrameNode.
Definition: base.h:100
Function nodes.
#define TVM_DEFINE_MUTABLE_NOTNULLABLE_OBJECT_REF_METHODS(TypeName, ParentType, ObjectName)
Definition: object.h:758
Definitions and helper macros for IR/AST nodes.
Base expr nodes in TVM.
runtime implementation for LibTorch/TorchScript.
Definition: analyzer.h:36
void ExitWithScope() final
The method called when exiting RAII scope.
Managed reference to IRModuleFrameNode.
Definition: frame.h:62
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
Array, container representing a contiguous sequence of ObjectRefs.
Definition: array.h:289
void VisitAttrs(tvm::AttrVisitor *v)
Definition: base.h:69
Array< GlobalVar > global_vars
Definition: frame.h:41
TVM_DECLARE_FINAL_OBJECT_INFO(IRModuleFrameNode, IRBuilderFrameNode)
Array< BaseFunc > functions
Definition: frame.h:42
A frame that represents the IRModule frame with functions and global variables.
Definition: frame.h:39
static constexpr const char * _type_key
Definition: frame.h:50
void VisitAttrs(tvm::AttrVisitor *v)
Definition: frame.h:44