From 0247b97198b0fecf82e6ca44d2f34bc8dfc3540f Mon Sep 17 00:00:00 2001
From: Tianqi Chen <tqchen@users.noreply.github.com>
Date: Thu, 4 Oct 2018 12:01:04 -0700
Subject: [PATCH] [RUNTIME] Fix debug runtime i386 build (#1818)

---
 src/runtime/graph/debug/graph_runtime_debug.cc | 17 +++++++++--------
 1 file changed, 9 insertions(+), 8 deletions(-)

diff --git a/src/runtime/graph/debug/graph_runtime_debug.cc b/src/runtime/graph/debug/graph_runtime_debug.cc
index 98127424f..7faee4420 100644
--- a/src/runtime/graph/debug/graph_runtime_debug.cc
+++ b/src/runtime/graph/debug/graph_runtime_debug.cc
@@ -19,10 +19,11 @@ namespace runtime {
  */
 class GraphRuntimeDebug : public GraphRuntime {
  public:
-    /*!
-     * \brief Run each operation and get the output.
-     * \param index The index of op which needs to be run.
-     */
+  /*!
+   * \brief Run each operation and get the output.
+   * \param index The index of op which needs to be run.
+   * \return the elapsed time.
+   */
   double DebugRun(size_t index) {
     CHECK(index < op_execs().size());
     TVMContext ctx = data_entry()[GetEntryId(index, 0)].operator->()->ctx;
@@ -104,7 +105,7 @@ PackedFunc GraphRuntimeDebug::GetFunction(
   // return member functions during query.
   if (name == "debug_run") {
     return PackedFunc([sptr_to_self, this](TVMArgs args, TVMRetValue* rv) {
-        *rv = this->DebugRun(args[0]);
+        *rv = this->DebugRun(static_cast<size_t>(args[0].operator int64_t()));
       });
   } else if (name == "get_output_by_layer") {
     return PackedFunc([sptr_to_self, this](TVMArgs args, TVMRetValue* rv) {
@@ -129,9 +130,9 @@ PackedFunc GraphRuntimeDebug::GetFunction(
  * \param m Compiled module which will be loaded.
  * \param ctxs All devices contexts.
  */
-  Module GraphRuntimeDebugCreate(const std::string& sym_json,
-                                 const tvm::runtime::Module& m,
-                                 const std::vector<TVMContext>& ctxs) {
+Module GraphRuntimeDebugCreate(const std::string& sym_json,
+                               const tvm::runtime::Module& m,
+                               const std::vector<TVMContext>& ctxs) {
   std::shared_ptr<GraphRuntimeDebug> exec = std::make_shared<GraphRuntimeDebug>();
   exec->Init(sym_json, m, ctxs);
   return Module(exec);
-- 
GitLab