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_S_TIR_META_SCHEDULE_EXTRACTED_TASK_H_
20 #define TVM_S_TIR_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 tirx {
31 class PrimFunc;
32 } // namespace tirx
33 namespace te {
34 class Tensor;
35 } // namespace te
36 } // namespace tvm
37 
38 namespace tvm {
39 namespace s_tir {
40 namespace meta_schedule {
41 
43 class ExtractedTaskNode : public runtime::Object {
44  public:
46  ffi::String task_name;
52  ffi::Array<IRModule> dispatched;
54  int weight;
55 
56  static void RegisterReflection() {
57  namespace refl = tvm::ffi::reflection;
58  refl::ObjectDef<ExtractedTaskNode>()
59  .def_ro("task_name", &ExtractedTaskNode::task_name)
60  .def_ro("mod", &ExtractedTaskNode::mod)
61  .def_ro("target", &ExtractedTaskNode::target)
62  .def_ro("dispatched", &ExtractedTaskNode::dispatched)
63  .def_ro("weight", &ExtractedTaskNode::weight);
64  }
65 
66  static constexpr const bool _type_mutable = true;
67  TVM_FFI_DECLARE_OBJECT_INFO_FINAL("s_tir.meta_schedule.ExtractedTask", ExtractedTaskNode,
68  runtime::Object);
69 };
70 
75 class ExtractedTask : public runtime::ObjectRef {
76  public:
77  explicit ExtractedTask(ffi::String task_name, IRModule mod, Target target,
78  ffi::Array<IRModule> dispatched, int weight);
81 };
82 
83 } // namespace meta_schedule
84 } // namespace s_tir
85 } // namespace tvm
86 
87 #endif // TVM_S_TIR_META_SCHEDULE_EXTRACTED_TASK_H_
Managed reference class to IRModuleNode.
Definition: module.h:257
Managed reference class to TargetNode.
Definition: target.h:135
A tuning task extracted from the high-level IR.
Definition: extracted_task.h:43
static constexpr const bool _type_mutable
Definition: extracted_task.h:66
static void RegisterReflection()
Definition: extracted_task.h:56
IRModule mod
The high-level IR.
Definition: extracted_task.h:48
int weight
Weight of the task.
Definition: extracted_task.h:54
TVM_FFI_DECLARE_OBJECT_INFO_FINAL("s_tir.meta_schedule.ExtractedTask", ExtractedTaskNode, runtime::Object)
ffi::Array< IRModule > dispatched
A list of low-level IRs that the high-level IR could potentially dispatch to.
Definition: extracted_task.h:52
ffi::String task_name
The name of the task extracted.
Definition: extracted_task.h:46
Target target
Target.
Definition: extracted_task.h:50
Managed reference to ExtractedTaskNode.
Definition: extracted_task.h:75
TVM_FFI_DEFINE_OBJECT_REF_METHODS_NOTNULLABLE(ExtractedTask, runtime::ObjectRef, ExtractedTaskNode)
ExtractedTask(ffi::String task_name, IRModule mod, Target target, ffi::Array< IRModule > dispatched, int weight)
Tensor structure representing a possible input, or intermediate computation result.
Definition: tensor.h:100
IRModule that holds the functions and type definitions.
Definition: repr_printer.h:91
PrimFuncFrame PrimFunc(bool is_private)
The primitive function statement.
tvm::PrimExpr mod(const tvm::PrimExpr &a, const tvm::PrimExpr &b)
Definition: broadcast.h:308
An object that builds and maintains block scope and StmtSref mapping for Dependence analysis.
Definition: analyzer.h:37
A managed object in the TVM runtime.
Compilation target object.