19 #ifndef TVM_META_SCHEDULE_DATABASE_H_ 20 #define TVM_META_SCHEDULE_DATABASE_H_ 35 namespace meta_schedule {
48 v->Visit(
"mod", &mod);
52 static constexpr
const char*
_type_key =
"meta_schedule.Workload";
120 v->Visit(
"trace", &trace);
121 v->Visit(
"workload", &workload);
122 v->Visit(
"run_secs", &run_secs);
123 v->Visit(
"target", &target);
124 v->Visit(
"args_info", &args_info);
127 static constexpr
const char*
_type_key =
"meta_schedule.TuningRecord";
164 TVM_DLL
static TuningRecord FromJSON(
const ObjectRef& json_obj,
const Workload& workload);
189 virtual void CommitTuningRecord(
const TuningRecord& record) = 0;
206 virtual int64_t Size() = 0;
215 const String& workload_name);
224 const String& workload_name);
233 const String& workload_name);
235 static constexpr
const char*
_type_key =
"meta_schedule.Database";
339 ICHECK(f_has_workload !=
nullptr) <<
"PyDatabase's HasWorkload method not implemented!";
340 return f_has_workload(
mod);
344 ICHECK(f_commit_workload !=
nullptr) <<
"PyDatabase's CommitWorkload method not implemented!";
345 return f_commit_workload(
mod);
349 ICHECK(f_commit_tuning_record !=
nullptr)
350 <<
"PyDatabase's CommitTuningRecord method not implemented!";
351 f_commit_tuning_record(record);
355 ICHECK(f_get_top_k !=
nullptr) <<
"PyDatabase's GetTopK method not implemented!";
356 return f_get_top_k(workload, top_k);
360 ICHECK(f_get_all_tuning_records !=
nullptr)
361 <<
"PyDatabase's GetAllTuningRecords method not implemented!";
362 return f_get_all_tuning_records();
366 const String& workload_name)
final {
367 if (f_query_tuning_record ==
nullptr) {
370 return f_query_tuning_record(
mod, target, workload_name);
375 const String& workload_name)
final {
376 if (f_query_schedule ==
nullptr) {
379 return f_query_schedule(
mod, target, workload_name);
384 const String& workload_name)
final {
385 if (f_query_ir_module ==
nullptr) {
388 return f_query_ir_module(
mod, target, workload_name);
393 ICHECK(f_size !=
nullptr) <<
"PyDatabase's Size method not implemented!";
397 static constexpr
const char*
_type_key =
"meta_schedule.PyDatabase";
408 TVM_DLL
static Database MemoryDatabase();
414 TVM_DLL
static Database ScheduleFnDatabase(
465 void EnterWithScope();
467 void ExitWithScope();
475 #endif // TVM_META_SCHEDULE_DATABASE_H_
#define TVM_DEFINE_MUTABLE_NOTNULLABLE_OBJECT_REF_METHODS(TypeName, ParentType, ObjectName)
Definition: object.h:758
Runtime String container types.
IRModule that holds the functions and type definitions.
runtime implementation for LibTorch/TorchScript.
Definition: analyzer.h:36
base class of all object containers.
Definition: object.h:167
Managed reference to ScheduleNode.
Definition: schedule.h:694
Content-aware structural equality comparator for objects.
Definition: structural_equal.h:103
Runtime Array container types.
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
Array, container representing a contiguous sequence of ObjectRefs.
Definition: array.h:289
Reference to string objects.
Definition: string.h:97
Managed reference class to TargetNode.
Definition: target.h:181
Base class of all object reference.
Definition: object.h:511
A managed object in the TVM runtime.
Managed reference class to IRModuleNode.
Definition: module.h:352
Compilation target object.
Managed reference to TraceNode.
Definition: trace.h:141
Optional container that to represent to a Nullable variant of T.
Definition: optional.h:51
Reflection and serialization of compiler IR/AST nodes.
#define TVM_DECLARE_BASE_OBJECT_INFO(TypeName, ParentType)
helper macro to declare a base object type that can be inherited.
Definition: object.h:648
#define TVM_DEFINE_NOTNULLABLE_OBJECT_REF_METHODS(TypeName, ParentType, ObjectName)
Definition: object.h:728
Type-erased function used across TVM API.