huajsj commented on a change in pull request #10234:
URL: https://github.com/apache/tvm/pull/10234#discussion_r806618058
##########
File path: src/runtime/pipeline/pipeline_executor.cc
##########
@@ -242,6 +237,13 @@ std::pair<int, int> PipelineExecutor::GetInputIndex(const
std::string& name) {
auto gruntime = runtimes_[index.first];
return std::make_pair(index.first, gruntime->GetInputIndex(index.second));
}
+/*!
+ * \brief Getting the times of pipeline running.
+ * \return Returning the times of pipeline running.
Review comment:
fixed.
##########
File path: src/runtime/pipeline/pipeline_scheduler.cc
##########
@@ -46,6 +47,10 @@ std::vector<std::shared_ptr<BackendRuntime>>
PipelineScheduler::PipelineInit(
NDArray output =
runtimes[output_pair.first]->CreateFromOutput(output_pair.second);
output_arrays_.push_back(output);
}
+ // Initializing and then running the work thread.
+ for (auto runtime : runtimes) {
+ runtime->Pipeline_Initialize(pipeline_config, &runtimes);
Review comment:
fixed.
##########
File path: src/runtime/pipeline/pipeline_struct.h
##########
@@ -42,6 +52,75 @@ using GlobalOutputPair = std::pair<int, int>;
* The first 'int' is the module index, and the second 'int' is the module
output index.
*/
using ModuleOutputPair = std::pair<int, int>;
+/*!
+ *\brief The pair includes the module index and the module input index.
+ * The first 'int' is the module index, and the second 'int' is the module
input index.
+ */
+using ModuleInputPair = std::pair<int, int>;
+/*!\brief The data notification structure.*/
+class DataNotify {
+ private:
+ /*!\brief The 'contitional variable' is used to wait for notification.*/
+ std::condition_variable condition_;
Review comment:
fixed.
##########
File path: src/runtime/pipeline/pipeline_struct.h
##########
@@ -42,6 +52,75 @@ using GlobalOutputPair = std::pair<int, int>;
* The first 'int' is the module index, and the second 'int' is the module
output index.
*/
using ModuleOutputPair = std::pair<int, int>;
+/*!
+ *\brief The pair includes the module index and the module input index.
+ * The first 'int' is the module index, and the second 'int' is the module
input index.
+ */
+using ModuleInputPair = std::pair<int, int>;
+/*!\brief The data notification structure.*/
+class DataNotify {
+ private:
+ /*!\brief The 'contitional variable' is used to wait for notification.*/
+ std::condition_variable condition_;
+ /*!\brief The mutex is used to protect the 'conditional variable'.*/
+ std::mutex mutex_;
+ /*!\brief Whether a data is ready or not.*/
+ volatile bool data_ready_ = false;
+ /*!\brief Whether the thread should exit or not.*/
+ volatile bool exit_state_ = false;
+ /*!\brief The index of runtime which is sending out the data notification.*/
+ int parent_idx_;
+ /*!\brief The index of runtime output interface which is sending out the
data notification.*/
+ int parent_output_idx_;
+
+ public:
+ /*!
+ * \brief Constructing the DataNotify class.
+ * \param parent_idx The index of runtime which is sending out the data
notification
+ * \param parent_output_idx The index of runtime output interface which is
sending out
+ * the data notification.
+ */
+ DataNotify(int parent_idx, int parent_output_idx) {
+ parent_idx_ = parent_idx;
+ parent_output_idx_ = parent_output_idx;
+ }
+ /*!
+ * \brief Getting the notification source.
+ * \return The first 'int' is the runtime index, and the second 'int' is the
output index.
+ */
+ std::pair<int, int> GetNotifySource(void) {
+ return std::make_pair(parent_idx_, parent_output_idx_);
+ }
+ /*!
+ *\brief Waiting the notification.
Review comment:
fixed.
##########
File path: src/runtime/pipeline/pipeline_struct.h
##########
@@ -53,6 +132,16 @@ class ConfigBindings {
int GetGlobalOutputIndex() const { return global_output_index_; }
/*!\brief Returning the binding configuration.*/
std::unordered_map<int, std::string>& Get() { return bindings_; }
+ /*!
+ * \brief Enumrating the binding configuration.
Review comment:
fixed.
##########
File path: src/runtime/pipeline/pipeline_struct.h
##########
@@ -189,6 +287,18 @@ class ConfigPipelineExecution {
ICHECK(config_.find(key) != config_.end());
return config_[key];
}
+ /*!
+ * \brief Enumurating the binding configuration for a specify runtime.
Review comment:
fixed.
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]