diff --git a/include/aidge/scheduler/Scheduler.hpp b/include/aidge/scheduler/Scheduler.hpp index faf6c49bdbe28e7214f06a4d116cf23a1739154f..6dcec5aaa4fa80aefebd538a1728445051ca080e 100644 --- a/include/aidge/scheduler/Scheduler.hpp +++ b/include/aidge/scheduler/Scheduler.hpp @@ -23,7 +23,7 @@ class Node; class GraphView; class SequentialScheduler { -public: +private: struct SchedulingElement { SchedulingElement( std::shared_ptr<Node> node_, @@ -36,6 +36,7 @@ public: std::chrono::time_point<std::chrono::high_resolution_clock> end; }; +public: SequentialScheduler(std::shared_ptr<GraphView> graphView) : mGraphView(graphView) { @@ -44,6 +45,10 @@ public: ~SequentialScheduler() = default; void generateScheduling(bool verbose = false); + inline void resetScheduling() { + mScheduling.clear(); + mStaticSchedule.clear(); + } /** * @brief Run the provided Computational Graph with a batch of data @@ -58,13 +63,12 @@ public: /** * @brief Return a vector of Node ordered by the order they are called by the scheduler - * * @return std::vector<std::shared_ptr<Node>> */ - std::vector<std::shared_ptr<Node>> getStaticScheduling(){ + inline std::vector<std::shared_ptr<Node>> getStaticScheduling() const noexcept { return mStaticSchedule; } - std::shared_ptr<GraphView> getGraphView(){ + inline std::shared_ptr<GraphView> getGraphView() const noexcept { return mGraphView; } @@ -77,20 +81,11 @@ private: */ std::set<std::shared_ptr<Node>> getConsumers(const std::set<std::shared_ptr<Node>>& producers) const; - /** - * @brief Shared ptr to the scheduled graph view - * - */ + /** @brief Shared ptr to the scheduled graph view */ std::shared_ptr<GraphView> mGraphView; - /** - * @brief List of SchedulingElement (i.e: Nodes with their computation time) - * - */ + /** @brief List of SchedulingElement (i.e: Nodes with their computation time) */ std::vector<SchedulingElement> mScheduling; - /** - * @brief List of nodes ordered by their - * - */ + /** @brief List of nodes ordered by their */ std::vector<std::shared_ptr<Node>> mStaticSchedule; }; } // namespace Aidge