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/ffi/container/array.h>
23 #include <tvm/ffi/reflection/registry.h>
24 #include <tvm/ffi/string.h>
25 #include <tvm/ir/module.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 
42 class ExtractedTaskNode : public runtime::Object {
43  public:
45  String task_name;
51  Array<IRModule> dispatched;
53  int weight;
54 
55  static void RegisterReflection() {
56  namespace refl = tvm::ffi::reflection;
57  refl::ObjectDef<ExtractedTaskNode>()
58  .def_ro("task_name", &ExtractedTaskNode::task_name)
59  .def_ro("mod", &ExtractedTaskNode::mod)
60  .def_ro("target", &ExtractedTaskNode::target)
61  .def_ro("dispatched", &ExtractedTaskNode::dispatched)
62  .def_ro("weight", &ExtractedTaskNode::weight);
63  }
64 
65  static constexpr const char* _type_key = "meta_schedule.ExtractedTask";
66 
68 };
69 
74 class ExtractedTask : public runtime::ObjectRef {
75  public:
76  explicit ExtractedTask(String task_name, IRModule mod, Target target, Array<IRModule> dispatched,
77  int weight);
80 };
81 
82 } // namespace meta_schedule
83 } // namespace tvm
84 
85 #endif // TVM_META_SCHEDULE_EXTRACTED_TASK_H_
Managed reference class to IRModuleNode.
Definition: module.h:257
Managed reference class to TargetNode.
Definition: target.h:191
A tuning task extracted from the high-level IR.
Definition: extracted_task.h:42
IRModule mod
The high-level IR.
Definition: extracted_task.h:47
static constexpr const char * _type_key
Definition: extracted_task.h:65
static void RegisterReflection()
Definition: extracted_task.h:55
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:74
TVM_DEFINE_MUTABLE_NOTNULLABLE_OBJECT_REF_METHODS(ExtractedTask, runtime::ObjectRef, ExtractedTaskNode)
ExtractedTask(String task_name, IRModule mod, Target target, Array< IRModule > dispatched, int weight)
Tensor structure representing a possible input, or intermediate computation result.
Definition: tensor.h:100
Managed reference to PrimFuncNode.
Definition: function.h:131
IRModule that holds the functions and type definitions.
Definition: repr_printer.h:91
tvm::PrimExpr mod(const tvm::PrimExpr &a, const tvm::PrimExpr &b)
Definition: broadcast.h:306
Performance counters for profiling via the PAPI library.
Definition: analyzer.h:37
A managed object in the TVM runtime.
Compilation target object.