tvm
tune_context.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_TUNE_CONTEXT_H_
20 #define TVM_META_SCHEDULE_TUNE_CONTEXT_H_
21 
22 #include <tvm/ir/module.h>
25 #include <tvm/target/target.h>
26 
27 namespace tvm {
28 namespace meta_schedule {
29 
32  public:
47 
49  bool is_stopped;
54 
56  v->Visit("mod", &mod);
57  v->Visit("target", &target);
58  v->Visit("space_generator", &space_generator);
59  v->Visit("search_strategy", &search_strategy);
60  v->Visit("task_name", &task_name);
61  v->Visit("rand_state", &rand_state);
62  v->Visit("num_threads", &num_threads);
63  v->Visit("is_stopped", &is_stopped);
64  v->Visit("runner_futures", &runner_futures);
65  v->Visit("measure_candidates", &measure_candidates);
66  }
67 
68  static constexpr const char* _type_key = "meta_schedule.TuneContext";
70 };
71 
77  public:
88  TVM_DLL explicit TuneContext(Optional<IRModule> mod, //
94  int num_threads);
96 };
97 
98 } // namespace meta_schedule
99 } // namespace tvm
100 
101 #endif // TVM_META_SCHEDULE_TUNE_CONTEXT_H_
bool is_stopped
Whether the tuning task has been stopped or finished.
Definition: tune_context.h:49
Optional< Target > target
The target to be tuned for.
Definition: tune_context.h:36
#define TVM_DEFINE_MUTABLE_NOTNULLABLE_OBJECT_REF_METHODS(TypeName, ParentType, ObjectName)
Definition: object.h:751
Random number generator. It provides a generic interface consistent with std::uniform_random_bit_gene...
Optional< Array< MeasureCandidate > > measure_candidates
The measure candidates.
Definition: tune_context.h:53
IRModule that holds the functions and type definitions.
Performance counters for profiling via the PAPI library.
Definition: analyzer.h:36
support::LinearCongruentialEngine::TRandState rand_state
The random state.
Definition: tune_context.h:44
Optional< String > task_name
The name of the tuning task.
Definition: tune_context.h:42
base class of all object containers.
Definition: object.h:165
Optional< SpaceGenerator > space_generator
The design space generator.
Definition: tune_context.h:38
Optional< IRModule > mod
The workload to be tuned.
Definition: tune_context.h:34
Managed reference to TuneContextNode.
Definition: tune_context.h:76
int64_t TRandState
Definition: random_engine.h:53
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
int num_threads
The number of threads to be used.
Definition: tune_context.h:46
Optional< SearchStrategy > search_strategy
The search strategy.
Definition: tune_context.h:40
The auto tuning context.
Definition: tune_context.h:31
TVM_DECLARE_FINAL_OBJECT_INFO(TuneContextNode, Object)
void VisitAttrs(tvm::AttrVisitor *v)
Definition: tune_context.h:55
Base class of all object reference.
Definition: object.h:504
static constexpr const char * _type_key
Definition: tune_context.h:68
Compilation target object.
Optional< Array< RunnerFuture > > runner_futures
Packed functions to fetch the runner results asynchronously.
Definition: tune_context.h:51
Optional container that to represent to a Nullable variant of T.
Definition: optional.h:51