5 #include "smaug/utility/debug_stream.h"
6 #include "smaug/utility/thread_pool.h"
7 #include "smaug/core/tensor.h"
8 #include "smaug/core/types.pb.h"
9 #include "smaug/core/scheduler.h"
14 std::cout <<
"======================================================\n";
15 std::cout <<
" Tiling operators of the network...\n";
16 std::cout <<
"======================================================\n";
17 for (
auto nameOp : network->getOperators()) {
19 dout(0) <<
"Tiling " << op->getName() <<
" ("
20 << OpType_Name(op->getOpType()) <<
").\n";
37 std::cout <<
"======================================================\n";
38 std::cout <<
" Scheduling operators of the network...\n";
39 std::cout <<
"======================================================\n";
42 for (
auto nameOp : network->getOperators()) {
44 Vertex vertex = op->getVertex();
45 int numPendingInputs = boost::in_degree(vertex, network->getGraph());
47 if (numPendingInputs == 0)
62 dout(0) <<
"Scheduling " << op->getName() <<
" ("
63 << OpType_Name(op->getOpType()) <<
").\n";
66 output = op->getOutput(0);
67 dout(2) << *output <<
"\n";
76 for (
auto output : op->getOutputs())
82 const Graph& graph = network->getGraph();
83 Vertex vertex = op->getVertex();
84 out_edge_iter outEdgeIt, outEdgeEnd;
85 for (boost::tie(outEdgeIt, outEdgeEnd) = out_edges(vertex, graph);
86 outEdgeIt != outEdgeEnd;
88 Vertex childVertex = target(*outEdgeIt, graph);
89 Operator* child = get(boost::vertex_op, graph, childVertex);
90 if (child->getNumPendingInputs() > 0) {
91 child->decrNumPendingInputs();
92 if (child->getNumPendingInputs() == 0)