tvm
extracted_task.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_META_SCHEDULE_EXTRACTED_TASK_H_
20 #define TVM_META_SCHEDULE_EXTRACTED_TASK_H_
21 
22 #include <tvm/ir/module.h>
23 #include <tvm/node/reflection.h>
26 #include <tvm/runtime/object.h>
27 #include <tvm/target/target.h>
28 
29 namespace tvm {
30 namespace tir {
31 class PrimFunc;
32 } // namespace tir
33 namespace te {
34 class Tensor;
35 } // namespace te
36 } // namespace tvm
37 
38 namespace tvm {
39 namespace meta_schedule {
40 
43  public:
53  int weight;
54 
56  v->Visit("task_name", &task_name);
57  v->Visit("mod", &mod);
58  v->Visit("target", &target);
59  v->Visit("dispatched", &dispatched);
60  v->Visit("weight", &weight);
61  }
62 
63  static constexpr const char* _type_key = "meta_schedule.ExtractedTask";
65 };
66 
72  public:
73  explicit ExtractedTask(String task_name, IRModule mod, Target target, Array<IRModule> dispatched,
74  int weight);
77 };
78 
79 } // namespace meta_schedule
80 } // namespace tvm
81 
82 #endif // TVM_META_SCHEDULE_EXTRACTED_TASK_H_
Runtime Array container types.
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
Managed reference class to IRModuleNode.
Definition: module.h:366
Managed reference class to TargetNode.
Definition: target.h:200
A tuning task extracted from the high-level IR.
Definition: extracted_task.h:42
void VisitAttrs(tvm::AttrVisitor *v)
Definition: extracted_task.h:55
IRModule mod
The high-level IR.
Definition: extracted_task.h:47
static constexpr const char * _type_key
Definition: extracted_task.h:63
int weight
Weight of the task.
Definition: extracted_task.h:53
Array< IRModule > dispatched
A list of low-level IRs that the high-level IR could potentially dispatch to.
Definition: extracted_task.h:51
String task_name
The name of the task extracted.
Definition: extracted_task.h:45
Target target
Target.
Definition: extracted_task.h:49
TVM_DECLARE_FINAL_OBJECT_INFO(ExtractedTaskNode, runtime::Object)
Managed reference to ExtractedTaskNode.
Definition: extracted_task.h:71
TVM_DEFINE_MUTABLE_NOTNULLABLE_OBJECT_REF_METHODS(ExtractedTask, runtime::ObjectRef, ExtractedTaskNode)
ExtractedTask(String task_name, IRModule mod, Target target, Array< IRModule > dispatched, int weight)
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
Reference to string objects.
Definition: string.h:98
Tensor structure representing a possible input, or intermediate computation result.
Definition: tensor.h:102
Managed reference to PrimFuncNode.
Definition: function.h:145
IRModule that holds the functions and type definitions.
tvm::PrimExpr mod(const tvm::PrimExpr &a, const tvm::PrimExpr &b)
Definition: broadcast.h:290
runtime implementation for LibTorch/TorchScript.
Definition: analyzer.h:36
A managed object in the TVM runtime.
Reflection and serialization of compiler IR/AST nodes.
Runtime String container types.
Compilation target object.