moved LoopGraph to json
This commit is contained in:
@@ -955,39 +955,7 @@ static int calculateNormalChildSize(const LoopGraph *currLoop)
|
|||||||
return count;
|
return count;
|
||||||
}
|
}
|
||||||
|
|
||||||
void convertToString(const LoopGraph *currLoop, string &result)
|
static json convertToJson(const LoopGraph* currLoop)
|
||||||
{
|
|
||||||
if (currLoop && currLoop->lineNum > 0)
|
|
||||||
{
|
|
||||||
char buf[512];
|
|
||||||
result += "#" + std::to_string(currLoop->calls.size());
|
|
||||||
for (int i = 0; i < currLoop->calls.size(); ++i)
|
|
||||||
result += "#" + currLoop->calls[i].first + "#" + std::to_string(currLoop->calls[i].second);
|
|
||||||
printToBuffer(currLoop, calculateNormalChildSize(currLoop), buf);
|
|
||||||
result += string(buf);
|
|
||||||
|
|
||||||
result += "#" + std::to_string(currLoop->linesOfExternalGoTo.size());
|
|
||||||
for (int i = 0; i < currLoop->linesOfExternalGoTo.size(); ++i)
|
|
||||||
result += "#" + std::to_string(currLoop->linesOfExternalGoTo[i]);
|
|
||||||
|
|
||||||
result += "#" + std::to_string(currLoop->linesOfInternalGoTo.size());
|
|
||||||
for (int i = 0; i < currLoop->linesOfInternalGoTo.size(); ++i)
|
|
||||||
result += "#" + std::to_string(currLoop->linesOfInternalGoTo[i]);
|
|
||||||
|
|
||||||
result += "#" + std::to_string(currLoop->linesOfIO.size());
|
|
||||||
for (auto& i : currLoop->linesOfIO)
|
|
||||||
result += "#" + std::to_string(i);
|
|
||||||
|
|
||||||
result += "#" + std::to_string(currLoop->linesOfStop.size());
|
|
||||||
for (auto& i : currLoop->linesOfStop)
|
|
||||||
result += "#" + std::to_string(i);
|
|
||||||
|
|
||||||
for (int i = 0; i < (int)currLoop->children.size(); ++i)
|
|
||||||
convertToString(currLoop->children[i], result);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
json convertToJson(const LoopGraph* currLoop)
|
|
||||||
{
|
{
|
||||||
json loop;
|
json loop;
|
||||||
const auto& file = currLoop->fileName;
|
const auto& file = currLoop->fileName;
|
||||||
|
|||||||
@@ -497,7 +497,6 @@ void processLoopInformationForFunction(std::map<LoopGraph*, std::map<DIST::Array
|
|||||||
void addToDistributionGraph(const std::map<LoopGraph*, std::map<DIST::Array*, ArrayInfo*>>& loopInfo, const std::map<DIST::Array*, std::set<DIST::Array*>>& arrayLinksByFuncCalls);
|
void addToDistributionGraph(const std::map<LoopGraph*, std::map<DIST::Array*, ArrayInfo*>>& loopInfo, const std::map<DIST::Array*, std::set<DIST::Array*>>& arrayLinksByFuncCalls);
|
||||||
void selectFreeLoopsForParallelization(const std::vector<LoopGraph*>& loops, const std::string& funcName, bool isDistribute, const std::vector<ParallelRegion*>& regions, std::vector<Messages>& messagesForFile);
|
void selectFreeLoopsForParallelization(const std::vector<LoopGraph*>& loops, const std::string& funcName, bool isDistribute, const std::vector<ParallelRegion*>& regions, std::vector<Messages>& messagesForFile);
|
||||||
|
|
||||||
void convertToString(const LoopGraph* currLoop, std::string& result);
|
|
||||||
int printLoopGraph(const char* fileName, const std::map<std::string, std::vector<LoopGraph*>>& loopGraph, bool withRegs = false);
|
int printLoopGraph(const char* fileName, const std::map<std::string, std::vector<LoopGraph*>>& loopGraph, bool withRegs = false);
|
||||||
void checkCountOfIter(std::map<std::string, std::vector<LoopGraph*>>& loopGraph, const std::map<std::string, std::vector<FuncInfo*>>& allFuncInfo, std::map<std::string, std::vector<Messages>>& SPF_messages);
|
void checkCountOfIter(std::map<std::string, std::vector<LoopGraph*>>& loopGraph, const std::map<std::string, std::vector<FuncInfo*>>& allFuncInfo, std::map<std::string, std::vector<Messages>>& SPF_messages);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user