SMAUG
Simulating Machine Learning Applications on gem5-Aladdin
scheduler.h
1 #include <list>
2 
3 #include "smaug/core/network.h"
4 #include "smaug/core/workspace.h"
5 #include "smaug/core/operator.h"
6 
7 namespace smaug {
8 
12 class Scheduler {
13  public:
14  Scheduler(Network* _network, Workspace* _workspace)
15  : network(_network), workspace(_workspace) {}
16  virtual ~Scheduler(){};
18  Tensor* runNetwork();
19 
20  protected:
26 
33  void maybeRunOperator(Operator* op);
34 
40  void updateChildren(Operator* op);
41 
42  Network* network;
43  Workspace* workspace;
44 
46  std::list<Operator*> readyQueue;
47 };
48 
49 } // namespace smaug
smaug::Tensor
Tensor represents a single multi-dimensional array of data.
Definition: tensor.h:344
smaug::Network
Network encapsulates all of the information SMAUG will use during execution: the overall computation ...
Definition: network.h:39
smaug::Scheduler::maybeRunOperator
void maybeRunOperator(Operator *op)
If none of the inputs to the current Operator are dead, then this will run the Operator; otherwise,...
Definition: scheduler.cpp:72
smaug::Scheduler::updateChildren
void updateChildren(Operator *op)
After an Operator is run, this updates the number of pending inputs on all its children.
Definition: scheduler.cpp:81
smaug::Workspace
Workspace is the container and owner of all Tensors and Operators in the Network.
Definition: workspace.h:17
smaug::Scheduler::runNetwork
Tensor * runNetwork()
Runs the Network to completion.
Definition: scheduler.cpp:13
smaug::Scheduler::scheduleReady
Tensor * scheduleReady()
Runs the operators in the ready queue.
Definition: scheduler.cpp:59
smaug::Operator
Operator is the base class for all graph operators supported by SMAUG.
Definition: operator.h:28
smaug
The smaug namespace is the parent namespace of all C++ code in SMAUG.
Definition: backend.cpp:38
smaug::Scheduler
Scheduler is responsible for running the Network.
Definition: scheduler.h:12
smaug::Scheduler::readyQueue
std::list< Operator * > readyQueue
The queue of all Operators ready to be executed.
Definition: scheduler.h:46