tkonolige commented on a change in pull request #7472:
URL: https://github.com/apache/tvm/pull/7472#discussion_r583033592



##########
File path: include/tvm/runtime/profiling.h
##########
@@ -37,55 +37,110 @@
 namespace tvm {
 namespace runtime {
 
+/*! \brief Base class for all implementations.
+ *
+ * New implementations of this interface should make sure that `Start` and 
`Stop`
+ * are as lightweight as possible. Expensive state synchronization should be
+ * done in `SyncAndGetTime`.
+ */
+class TimerNode : public Object {
+ public:
+  /*! \brief Start the timer.
+   *
+   * Note: this function should only be called once per object.
+   */
+  virtual void Start() = 0;
+  /*! \brief Stop the timer.
+   *
+   * Note: this function should only be called once per object.
+   */
+  virtual void Stop() = 0;
+  /*! \brief Synchronize timer state and return elapsed time between `Start` 
and `Stop`.

Review comment:
       It does not call TVMSynchronize under the hood. Only the `DefaultTimer` 
does that.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to