tvm
Loading...
Searching...
No Matches
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/ir/prim/expr.h>
27#include <tvm/target/target.h>
28
29namespace tvm {
30namespace tirx {
31class Function;
32} // namespace tirx
33namespace te {
34class Tensor;
35} // namespace te
36} // namespace tvm
37
38namespace tvm {
39namespace s_tir {
40namespace meta_schedule {
41
43class ExtractedTaskObj : public ffi::Object {
44 public:
45 explicit ExtractedTaskObj(ffi::UnsafeInit tag) : target(tag) {}
46
47 explicit ExtractedTaskObj(Target target) : target(std::move(target)) {}
49 ffi::String task_name;
55 ffi::Array<IRModule> dispatched;
57 int weight;
58
59 static void RegisterReflection() {
60 namespace refl = tvm::ffi::reflection;
61 refl::ObjectDef<ExtractedTaskObj>()
62 .def_ro("task_name", &ExtractedTaskObj::task_name)
63 .def_ro("mod", &ExtractedTaskObj::mod)
64 .def_ro("target", &ExtractedTaskObj::target)
65 .def_ro("dispatched", &ExtractedTaskObj::dispatched)
66 .def_ro("weight", &ExtractedTaskObj::weight);
67 }
68
69 static constexpr const bool _type_mutable = true;
70 TVM_FFI_DECLARE_OBJECT_INFO_FINAL("s_tir.meta_schedule.ExtractedTask", ExtractedTaskObj,
71 ffi::Object);
72};
73
78class ExtractedTask : public ffi::ObjectRef {
79 public:
80 explicit ExtractedTask(ffi::String task_name, IRModule mod, Target target,
81 ffi::Array<IRModule> dispatched, int weight);
83};
84
85} // namespace meta_schedule
86} // namespace s_tir
87} // namespace tvm
88
89#endif // TVM_S_TIR_META_SCHEDULE_EXTRACTED_TASK_H_
Managed reference class to IRModuleNode.
Definition module.h:255
Managed reference class to TargetObj.
Definition target.h:136
A tuning task extracted from the high-level IR.
Definition extracted_task.h:43
ffi::Array< IRModule > dispatched
A list of low-level IRs that the high-level IR could potentially dispatch to.
Definition extracted_task.h:55
static constexpr const bool _type_mutable
Definition extracted_task.h:69
IRModule mod
The high-level IR.
Definition extracted_task.h:51
TVM_FFI_DECLARE_OBJECT_INFO_FINAL("s_tir.meta_schedule.ExtractedTask", ExtractedTaskObj, ffi::Object)
ffi::String task_name
The name of the task extracted.
Definition extracted_task.h:49
int weight
Weight of the task.
Definition extracted_task.h:57
ExtractedTaskObj(ffi::UnsafeInit tag)
Definition extracted_task.h:45
ExtractedTaskObj(Target target)
Definition extracted_task.h:47
static void RegisterReflection()
Definition extracted_task.h:59
Target target
Target.
Definition extracted_task.h:53
Managed reference to ExtractedTaskObj.
Definition extracted_task.h:78
TVM_FFI_DEFINE_OBJECT_REF_METHODS_NOTNULLABLE(ExtractedTask, ffi::ObjectRef, ExtractedTaskObj)
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:111
TIR expressions.
IRModule that holds the functions and type definitions.
tvm::relax::Function Function
Definition transform.h:38
An object that builds and maintains block scope and StmtSref mapping for Dependence analysis.
Definition attr.h:23
Compilation target object.