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 PrimFunc;
32} // namespace tirx
33namespace te {
34class Tensor;
35} // namespace te
36} // namespace tvm
37
38namespace tvm {
39namespace s_tir {
40using namespace tvm::prim;
41namespace meta_schedule {
42
44class ExtractedTaskNode : public ffi::Object {
45 public:
47 ffi::String task_name;
53 ffi::Array<IRModule> dispatched;
55 int weight;
56
57 static void RegisterReflection() {
58 namespace refl = tvm::ffi::reflection;
59 refl::ObjectDef<ExtractedTaskNode>()
60 .def_ro("task_name", &ExtractedTaskNode::task_name)
61 .def_ro("mod", &ExtractedTaskNode::mod)
62 .def_ro("target", &ExtractedTaskNode::target)
63 .def_ro("dispatched", &ExtractedTaskNode::dispatched)
64 .def_ro("weight", &ExtractedTaskNode::weight);
65 }
66
67 static constexpr const bool _type_mutable = true;
68 TVM_FFI_DECLARE_OBJECT_INFO_FINAL("s_tir.meta_schedule.ExtractedTask", ExtractedTaskNode,
69 ffi::Object);
70};
71
76class ExtractedTask : public ffi::ObjectRef {
77 public:
78 explicit ExtractedTask(ffi::String task_name, IRModule mod, Target target,
79 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:255
Managed reference class to TargetNode.
Definition target.h:134
RAII wrapper function to enter and exit a context object similar to python's with syntax.
Definition with_context.h:59
A tuning task extracted from the high-level IR.
Definition extracted_task.h:44
static constexpr const bool _type_mutable
Definition extracted_task.h:67
static void RegisterReflection()
Definition extracted_task.h:57
IRModule mod
The high-level IR.
Definition extracted_task.h:49
int weight
Weight of the task.
Definition extracted_task.h:55
ffi::Array< IRModule > dispatched
A list of low-level IRs that the high-level IR could potentially dispatch to.
Definition extracted_task.h:53
ffi::String task_name
The name of the task extracted.
Definition extracted_task.h:47
TVM_FFI_DECLARE_OBJECT_INFO_FINAL("s_tir.meta_schedule.ExtractedTask", ExtractedTaskNode, ffi::Object)
Target target
Target.
Definition extracted_task.h:51
Managed reference to ExtractedTaskNode.
Definition extracted_task.h:76
TVM_FFI_DEFINE_OBJECT_REF_METHODS_NOTNULLABLE(ExtractedTask, ffi::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:98
TIR expressions.
IRModule that holds the functions and type definitions.
Definition builtin.h:25
PrimFuncFrame PrimFunc(bool is_private, bool s_tir=false, bool persistent=false)
The primitive function statement.
An object that builds and maintains block scope and StmtSref mapping for Dependence analysis.
Definition analyzer.h:40
Compilation target object.