19 #ifndef TVM_META_SCHEDULE_TUNE_CONTEXT_H_
20 #define TVM_META_SCHEDULE_TUNE_CONTEXT_H_
22 #include <tvm/ffi/container/array.h>
23 #include <tvm/ffi/container/map.h>
24 #include <tvm/ffi/function.h>
25 #include <tvm/ffi/optional.h>
26 #include <tvm/ffi/reflection/registry.h>
27 #include <tvm/ffi/string.h>
39 namespace meta_schedule {
41 class TaskSchedulerNode;
42 class MeasureCallback;
51 ffi::Optional<IRModule>
mod;
69 refl::ObjectDef<TuneContextNode>()
105 explicit TuneContext(ObjectPtr<TuneContextNode> data) : ObjectRef(data) {
106 TVM_FFI_ICHECK(data !=
nullptr);
119 TVM_DLL
explicit TuneContext(ffi::Optional<IRModule>
mod, ffi::Optional<Target> target,
120 ffi::Optional<SpaceGenerator> space_generator,
121 ffi::Optional<SearchStrategy> search_strategy,
122 ffi::Optional<ffi::String> task_name,
int num_threads,
The auto tuning context.
Definition: tune_context.h:46
TVM_FFI_DECLARE_OBJECT_INFO_FINAL("meta_schedule.TuneContext", TuneContextNode, Object)
TRandState rand_state
The random state.
Definition: tune_context.h:63
static void RegisterReflection()
Definition: tune_context.h:67
ffi::Optional< Target > target
The target to be tuned for.
Definition: tune_context.h:53
ffi::Optional< SearchStrategy > search_strategy
The search strategy.
Definition: tune_context.h:57
TuneContext Clone() const
Clone the tune context.
void Initialize()
Initialize members that needs initialization with tune context.
support::LinearCongruentialEngine::TRandState TRandState
Definition: tune_context.h:48
int num_threads
The number of threads to be used.
Definition: tune_context.h:61
ffi::Function logger
The tuning task's logging function. t.
Definition: tune_context.h:65
ffi::Optional< ffi::String > task_name
The name of the tuning task.
Definition: tune_context.h:59
ffi::Optional< SpaceGenerator > space_generator
The design space generator.
Definition: tune_context.h:55
static constexpr const bool _type_mutable
Definition: tune_context.h:90
ffi::Optional< IRModule > mod
The workload to be tuned.
Definition: tune_context.h:51
Managed reference to TuneContextNode.
Definition: tune_context.h:98
TuneContext(ffi::Optional< IRModule > mod, ffi::Optional< Target > target, ffi::Optional< SpaceGenerator > space_generator, ffi::Optional< SearchStrategy > search_strategy, ffi::Optional< ffi::String > task_name, int num_threads, TRandState rand_state, ffi::Function logger)
Constructor.
TVM_FFI_DEFINE_OBJECT_REF_METHODS_NOTNULLABLE(TuneContext, ObjectRef, TuneContextNode)
TuneContext(ObjectPtr< TuneContextNode > data)
Constructor from ObjectPtr<TuneContextNode>.
Definition: tune_context.h:105
support::LinearCongruentialEngine::TRandState TRandState
Definition: tune_context.h:100
int64_t TRandState
Definition: random_engine.h:46
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:308
Performance counters for profiling via the PAPI library.
Definition: analyzer.h:37
A managed object in the TVM runtime.
Random number generator. It provides a generic interface consistent with std::uniform_random_bit_gene...
Compilation target object.