From 58644c76dff196437b60106c64e06611b4bea2b1 Mon Sep 17 00:00:00 2001 From: huajsj Date: Wed, 15 Dec 2021 21:20:22 -0800 Subject: [PATCH] addres review comments. --- src/runtime/pipeline/pipeline_executor.cc | 2 +- src/runtime/pipeline/pipeline_executor.h | 2 +- src/runtime/pipeline/pipeline_struct.h | 3 +-- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/runtime/pipeline/pipeline_executor.cc b/src/runtime/pipeline/pipeline_executor.cc index 1d7cb6b8bd69..491e1e49f805 100644 --- a/src/runtime/pipeline/pipeline_executor.cc +++ b/src/runtime/pipeline/pipeline_executor.cc @@ -127,7 +127,7 @@ void PipelineExecutor::Init(const std::vector& modules, const std::strin // Use JSONReader to load pipeline configuration. std::istringstream is(pipeline_json); dmlc::JSONReader reader(&is); - ConfigPipelineExecution& pipeline_config = this->LoadConfigPipelineExecution(&reader); + ConfigPipelineExecution& pipeline_config = this->LoadConfig(&reader); ICHECK(!pipeline_config.Empty()) << "The pipeline config information is empty."; // Initialize the pipeline function class used for pipeline thread pool management // and schedule etc. This function returns the number of output. diff --git a/src/runtime/pipeline/pipeline_executor.h b/src/runtime/pipeline/pipeline_executor.h index 5d8492836fb8..28234e1bdcf0 100644 --- a/src/runtime/pipeline/pipeline_executor.h +++ b/src/runtime/pipeline/pipeline_executor.h @@ -131,7 +131,7 @@ class TVM_DLL PipelineExecutor : public ModuleNode { /*!\brief How many outputs are in this pipeline executor.*/ size_t num_outputs_ = 0; /*!\brief Json loader.*/ - ConfigPipelineExecution& LoadConfigPipelineExecution(dmlc::JSONReader* reader) { + ConfigPipelineExecution& LoadConfig(dmlc::JSONReader* reader) { reader->BeginObject(); std::string key; while (reader->NextObjectItem(&key)) { diff --git a/src/runtime/pipeline/pipeline_struct.h b/src/runtime/pipeline/pipeline_struct.h index 007a7d8aed7e..52422b764564 100644 --- a/src/runtime/pipeline/pipeline_struct.h +++ b/src/runtime/pipeline/pipeline_struct.h @@ -27,14 +27,13 @@ #include #include #include -#define GLOBAL_MODULE_INDEX -1 /*! * \brief All binding information of a output interface. */ class ConfigBindings { public: /*!\brief Whether this binding is bound to the PipelineExecutor output interface.*/ - bool IsGlobalOutput() const { return global_output_index_ > GLOBAL_MODULE_INDEX; } + bool IsGlobalOutput() const { return global_output_index_ > -1; } /*! * \brief Create a module interface map from JSONReader.