24 #ifndef TVM_RUNTIME_TIMER_H_
25 #define TVM_RUNTIME_TIMER_H_
27 #include <tvm/ffi/function.h>
77 class Timer :
public ffi::ObjectRef {
187 int min_repeat_ms,
int limit_zero_time_iterations,
188 int cooldown_interval_ms,
int repeats_to_cooldown,
189 int cache_flush_bytes = 0,
ffi::Function f_preproc =
nullptr);
Base class for all timer implementations.
Definition: timer.h:41
virtual int64_t SyncAndGetElapsedNanos()=0
Synchronize timer state and return elapsed time between Start and Stop.
virtual void Stop()=0
Stop the timer.
virtual void Start()=0
Start the timer.
static constexpr const bool _type_mutable
Definition: timer.h:67
virtual ~TimerNode()
Definition: timer.h:65
TVM_FFI_DECLARE_OBJECT_INFO("runtime.TimerNode", TimerNode, ffi::Object)
Timer for a specific device.
Definition: timer.h:77
static TVM_RUNTIME_DLL Timer Start(Device dev)
Get a device specific timer.
TVM_FFI_DEFINE_OBJECT_REF_METHODS_NULLABLE(Timer, ffi::ObjectRef, TimerNode)
Abstract device memory management API.
ffi::Function WrapTimeEvaluator(ffi::Function f, Device dev, int number, int repeat, int min_repeat_ms, int limit_zero_time_iterations, int cooldown_interval_ms, int repeats_to_cooldown, int cache_flush_bytes=0, ffi::Function f_preproc=nullptr)
Wrap a timer function to measure the time cost of a given packed function.
Tensor repeat(const Tensor &x, int repeats, int axis, std::string name="T_repeat", std::string tag=kBroadcast)
Creates an operation to repeat elements of an array.
Definition: transform.h:1370
An object that builds and maintains block scope and StmtSref mapping for Dependence analysis.
Definition: analyzer.h:37
DLDevice Device
Definition: device_api.h:43
#define TVM_RUNTIME_DLL
Definition: base.h:88
A device-independent managed Tensor abstraction.