1 Commits

4 changed files with 10 additions and 82 deletions

View File

@@ -9,7 +9,6 @@
#include "DvmhDirectiveBase.h"
#include "../Utils/utils.h"
#include "../Utils/errors.h"
#include "../Utils/json.hpp"
class Symbol;
class Expression;
@@ -21,7 +20,6 @@ struct FuncInfo;
#define MAP std::map
#define SET std::set
#define TO_STR std::to_string
#define JSON nlohmann::json
#if __SPF
extern int sharedMemoryParallelization;
@@ -426,7 +424,6 @@ namespace Distribution
void ClearShadowSpecs() { allShadowSpecs.clear(); }
//TODO: to remove
STRING toString()
{
STRING retVal = "";
@@ -469,63 +466,6 @@ namespace Distribution
return retVal;
}
JSON toJson()
{
JSON retVal;
retVal["id"] = (int64_t)id;
retVal["name"] = name;
retVal["shortName"] = shortName;
retVal["dimSize"] = dimSize;
retVal["typeSize"] = typeSize;
retVal["state"] = (int)isNonDistribute;
retVal["location"] = (int)locationPos.first;
retVal["locName"] = locationPos.second;
retVal["isTemplFlag"] = (int)isTemplFlag;
retVal["isLoopArrayFlag"] = (int)isLoopArrayFlag;
JSON deprToDist = nlohmann::json::array();
for (int i = 0; i < depracateToDistribute.size(); ++i)
deprToDist.push_back((int)depracateToDistribute[i]);
retVal["depracateToDist"] = deprToDist;
JSON mappedDimsJ = nlohmann::json::array();
for (int i = 0; i < mappedDims.size(); ++i)
mappedDimsJ.push_back((int)mappedDims[i]);
retVal["mappedDims"] = mappedDimsJ;
JSON sizesJ = nlohmann::json::array();
for (int i = 0; i < sizes.size(); ++i)
{
JSON pair;
pair["key"] = sizes[i].first;
pair["value"] = sizes[i].second;
sizesJ.push_back(pair);
}
retVal["sizes"] = sizesJ;
JSON regions = nlohmann::json::array();
for (auto& reg : containsInRegions)
regions.push_back(reg);
retVal["regions"] = regions;
JSON declPlacesJ = nlohmann::json::array();
for (auto& place : declPlaces)
{
JSON elem;
elem["file"] = place.first;
elem["line"] = place.second;
declPlacesJ.push_back(elem);
}
retVal["declPlaces"] = declPlacesJ;
return retVal;
}
Array* GetTemplateArray(const uint64_t regionId, bool withCheck = true)
{
TemplateLink *currLink = getTemlateInfo(regionId, withCheck);

View File

@@ -309,18 +309,9 @@ static void getModuleSymbols(SgStatement* func, set<SgSymbol*>& symbs)
SgSymbol* s = func->symbol()->next();
while (s)
{
if (func->variant() == MODULE_STMT)
{
if (s->scope() && s->scope()->symbol() && s->scope()->symbol()->identifier())
if (s->scope()->symbol()->identifier() == currScope)
symbs.insert(s);
}
else
{
if (IS_BY_USE(s) && s->scope() && s->scope()->symbol()->identifier() == currScope)
symbs.insert(s);
}
s = s->next();
}
}
@@ -334,9 +325,9 @@ const set<SgSymbol*>& getModuleSymbols(SgStatement *func)
set<SgSymbol*> symbs;
getModuleSymbols(func, symbs);
//if function or module in contains
//if function in contains
auto cp = func->controlParent();
if (isSgProgHedrStmt(cp) || cp->variant() == MODULE_STMT)
if (isSgProgHedrStmt(cp))
getModuleSymbols(cp, symbs);
symbolsForFunc[func->symbol()->identifier()] = symbs;

View File

@@ -1,3 +1,3 @@
#pragma once
#define VERSION_SPF "2417"
#define VERSION_SPF "2415"

View File

@@ -1416,17 +1416,14 @@ int SPF_GetAllDeclaratedArrays(void*& context, int winHandler, short *options, s
{
runPassesForVisualizer(projName, { GET_ALL_ARRAY_DECL });
json arrays = json::array();
for (const auto& [_, array] : declaredArrays)
string resVal = "";
for (auto f = declaredArrays.begin(); f != declaredArrays.end(); ++f)
{
json jArray = array.first->toJson();
arrays.push_back(jArray);
if (f != declaredArrays.begin())
resVal += "@";
resVal += f->second.first->toString();
}
json allArrays;
allArrays["allArrays"] = arrays;
string resVal = allArrays.dump();
copyStringToShort(result, resVal);
retSize = (int)resVal.size() + 1;
}