19#ifndef TVM_S_TIR_META_SCHEDULE_TUNE_CONTEXT_H_
20#define TVM_S_TIR_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>
41namespace meta_schedule {
43class TaskSchedulerNode;
53 ffi::Optional<IRModule>
mod;
70 namespace refl = tvm::ffi::reflection;
71 refl::ObjectDef<TuneContextNode>()
108 explicit TuneContext(ffi::ObjectPtr<TuneContextNode> data) : ffi::ObjectRef(data) {
123 ffi::Optional<SpaceGenerator> space_generator,
124 ffi::Optional<SearchStrategy> search_strategy,
125 ffi::Optional<ffi::String> task_name,
int num_threads,
RAII wrapper function to enter and exit a context object similar to python's with syntax.
Definition with_context.h:59
int64_t TRandState
Definition random_engine.h:49
The auto tuning context.
Definition tune_context.h:48
void Initialize()
Initialize members that needs initialization with tune context.
ffi::Optional< Target > target
The target to be tuned for.
Definition tune_context.h:55
TRandState rand_state
The random state.
Definition tune_context.h:65
ffi::Function logger
The tuning task's logging function. t.
Definition tune_context.h:67
ffi::Optional< SpaceGenerator > space_generator
The design space generator.
Definition tune_context.h:57
static void RegisterReflection()
Definition tune_context.h:69
ffi::Optional< IRModule > mod
The workload to be tuned.
Definition tune_context.h:53
ffi::Optional< SearchStrategy > search_strategy
The search strategy.
Definition tune_context.h:59
static constexpr const bool _type_mutable
Definition tune_context.h:92
int num_threads
The number of threads to be used.
Definition tune_context.h:63
ffi::Optional< ffi::String > task_name
The name of the tuning task.
Definition tune_context.h:61
TuneContext Clone() const
Clone the tune context.
TVM_FFI_DECLARE_OBJECT_INFO_FINAL("s_tir.meta_schedule.TuneContext", TuneContextNode, ffi::Object)
Managed reference to TuneContextNode.
Definition tune_context.h:101
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, ffi::ObjectRef, TuneContextNode)
TuneContext(ffi::ObjectPtr< TuneContextNode > data)
Constructor from ffi::ObjectPtr<TuneContextNode>.
Definition tune_context.h:108
IRModule that holds the functions and type definitions.
An object that builds and maintains block scope and StmtSref mapping for Dependence analysis.
Definition analyzer.h:40
Random number generator. It provides a generic interface consistent with std::uniform_random_bit_gene...
Compilation target object.