19#ifndef TVM_S_TIR_META_SCHEDULE_RUNNER_H_
20#define TVM_S_TIR_META_SCHEDULE_RUNNER_H_
22#include <tvm/ffi/container/array.h>
23#include <tvm/ffi/function.h>
24#include <tvm/ffi/optional.h>
25#include <tvm/ffi/reflection/registry.h>
26#include <tvm/ffi/string.h>
33namespace meta_schedule {
46 namespace refl = tvm::ffi::reflection;
47 refl::ObjectDef<RunnerInputObj>()
67 TVM_DLL
explicit RunnerInput(ffi::String artifact_path, ffi::String device_type,
68 ffi::Array<ArgInfo> args_info);
81 namespace refl = tvm::ffi::reflection;
82 refl::ObjectDef<RunnerResultObj>()
101 TVM_DLL
explicit RunnerResult(ffi::Optional<ffi::Array<FloatImm>> run_secs,
102 ffi::Optional<ffi::String> error_msg);
117 using FDone = ffi::TypedFunction<bool()>;
132 namespace refl = tvm::ffi::reflection;
133 refl::ObjectDef<RunnerFutureObj>();
141 TVM_FFI_ICHECK(
f_done !=
nullptr) <<
"PyRunnerFuture's Done method not implemented!";
149 TVM_FFI_ICHECK(
f_result !=
nullptr) <<
"PyRunnerFuture's Result method not implemented!";
183 using FRun = ffi::TypedFunction<ffi::Array<RunnerFuture>(ffi::Array<RunnerInput>)>;
193 virtual ffi::Array<RunnerFuture>
Run(ffi::Array<RunnerInput> runner_inputs) = 0;
196 namespace refl = tvm::ffi::reflection;
197 refl::ObjectDef<RunnerObj>();
215 explicit Runner(ffi::ObjectPtr<RunnerObj> data) : ffi::ObjectRef(data) {
216 TVM_FFI_ICHECK(data !=
nullptr);
235 namespace refl = tvm::ffi::reflection;
236 refl::ObjectDef<PyRunnerObj>();
239 ffi::Array<RunnerFuture>
Run(ffi::Array<RunnerInput> runner_inputs)
final {
240 TVM_FFI_ICHECK(
f_run !=
nullptr) <<
"PyRunner's Run method not implemented!";
241 return f_run(runner_inputs);
An object that builds and maintains block scope and StmtSref mapping for Dependence analysis.
Definition attr.h:23