Unverified Commit 0247b971 by Tianqi Chen Committed by GitHub

[RUNTIME] Fix debug runtime i386 build (#1818)

parent d713d63d
...@@ -19,10 +19,11 @@ namespace runtime { ...@@ -19,10 +19,11 @@ namespace runtime {
*/ */
class GraphRuntimeDebug : public GraphRuntime { class GraphRuntimeDebug : public GraphRuntime {
public: public:
/*! /*!
* \brief Run each operation and get the output. * \brief Run each operation and get the output.
* \param index The index of op which needs to be run. * \param index The index of op which needs to be run.
*/ * \return the elapsed time.
*/
double DebugRun(size_t index) { double DebugRun(size_t index) {
CHECK(index < op_execs().size()); CHECK(index < op_execs().size());
TVMContext ctx = data_entry()[GetEntryId(index, 0)].operator->()->ctx; TVMContext ctx = data_entry()[GetEntryId(index, 0)].operator->()->ctx;
...@@ -104,7 +105,7 @@ PackedFunc GraphRuntimeDebug::GetFunction( ...@@ -104,7 +105,7 @@ PackedFunc GraphRuntimeDebug::GetFunction(
// return member functions during query. // return member functions during query.
if (name == "debug_run") { if (name == "debug_run") {
return PackedFunc([sptr_to_self, this](TVMArgs args, TVMRetValue* rv) { 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") { } else if (name == "get_output_by_layer") {
return PackedFunc([sptr_to_self, this](TVMArgs args, TVMRetValue* rv) { return PackedFunc([sptr_to_self, this](TVMArgs args, TVMRetValue* rv) {
...@@ -129,9 +130,9 @@ PackedFunc GraphRuntimeDebug::GetFunction( ...@@ -129,9 +130,9 @@ PackedFunc GraphRuntimeDebug::GetFunction(
* \param m Compiled module which will be loaded. * \param m Compiled module which will be loaded.
* \param ctxs All devices contexts. * \param ctxs All devices contexts.
*/ */
Module GraphRuntimeDebugCreate(const std::string& sym_json, Module GraphRuntimeDebugCreate(const std::string& sym_json,
const tvm::runtime::Module& m, const tvm::runtime::Module& m,
const std::vector<TVMContext>& ctxs) { const std::vector<TVMContext>& ctxs) {
std::shared_ptr<GraphRuntimeDebug> exec = std::make_shared<GraphRuntimeDebug>(); std::shared_ptr<GraphRuntimeDebug> exec = std::make_shared<GraphRuntimeDebug>();
exec->Init(sym_json, m, ctxs); exec->Init(sym_json, m, ctxs);
return Module(exec); return Module(exec);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment