Commit 2883719a authored by Mintz, Tiffany's avatar Mintz, Tiffany
Browse files

making output tensor execution table a nested map so it can be associated with the current scope

parent 9754d09c
......@@ -16,11 +16,20 @@ void TensorRuntime::closeScope() { currentScope = ""; }
void TensorRuntime::submit(std::shared_ptr<TensorOperation> op) {
//upate the output tensor executation table
int newop_outid = op->getTensorOperandId(0);
std::map<std::string, std::map<int, int>>::iterator curTableIter;
std::map<int, int>::iterator &cur_table;
mtx.lock();
if(outTensorExec.find(newop_outid)==outTensorExec.end())
outTensorExec[newop_outid]==1;
curTableIter = outTensorExecTbl.find(currentScope);
if(curTableIter != outTensorExecTbl.end())
{
cur_table = curTableIter.second;
if(cur_table.find(newop_outid)==cur_table.end())
cur_table[newop_outid]=1;
else
cur_table[newop_outid]+=1;
}
else
outTensorExec[newop_outid]+=1;
outTensorExeciTbl[currentScope][newop_outid]=1;
// work on graph at dags[currentScope]
// add on to the graph
......
......@@ -17,7 +17,7 @@ class TensorRuntime {
protected:
std::map<std::string, std::shared_ptr<TensorGraph>> dags;
std::string currentScope;
std::map<int, int> outTensorExec; //table for tracking output tensor execution
std::map<std::string, map<int, int>> outTensorExecTbl; //table for tracking output tensor execution
std::mutex mtx; // mutex for lock on outTensorExec and dags
public:
void openScope(const std::string &scopeName);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment