fixed -tinfo option

This commit is contained in:
ALEXks
2023-10-07 13:16:09 +03:00
parent e2b2a029e5
commit 020f2a1109
3 changed files with 11 additions and 8 deletions

View File

@@ -2537,10 +2537,10 @@ void runPass(const int curr_regime, const char *proj_name, const char *folderNam
} }
FILE* templatesInfo = NULL; FILE* templatesInfo = NULL;
if (consoleMode) { if (consoleMode && withTemplateInfo) {
string file = (folderName) ? (folderName + string("/")) : ""; string file = (folderName) ? (folderName + string("/")) : "";
file += "templates_info_"; file += "templates_info_";
file += to_string(i); file += to_string(i + 1);
file += ".txt"; file += ".txt";
templatesInfo = fopen(file.c_str(), "w"); templatesInfo = fopen(file.c_str(), "w");
@@ -2550,7 +2550,7 @@ void runPass(const int curr_regime, const char *proj_name, const char *folderNam
for (int z = 0; z < parallelRegions.size(); ++z) for (int z = 0; z < parallelRegions.size(); ++z)
{ {
if (consoleMode) if (consoleMode && withTemplateInfo)
fprintf(templatesInfo, "FOR region %s\n", parallelRegions[z]->GetName().c_str()); fprintf(templatesInfo, "FOR region %s\n", parallelRegions[z]->GetName().c_str());
const DataDirective& dataDirectives = parallelRegions[z]->GetDataDir(); const DataDirective& dataDirectives = parallelRegions[z]->GetDataDir();
@@ -2561,10 +2561,10 @@ void runPass(const int curr_regime, const char *proj_name, const char *folderNam
{ {
if (tmp[z1].first->IsTemplate()) if (tmp[z1].first->IsTemplate())
{ {
if (consoleMode) if (consoleMode && withTemplateInfo)
{ {
SgExpression* rule = new SgExpression(EXPR_LIST); SgExpression* rule = new SgExpression(EXPR_LIST);
tmp[z1].second[currentVariants[z1][z]].GenRule(new File(current_file), new Expression(rule), tmp[z1].first->GetNewTemplateDimsOrder()); tmp[z1].second[currentVariant[z1]].GenRule(new File(current_file), new Expression(rule), tmp[z1].first->GetNewTemplateDimsOrder());
fprintf(templatesInfo, "%s(%s)\n", tmp[z1].first->GetShortName().c_str(), rule->unparse()); fprintf(templatesInfo, "%s(%s)\n", tmp[z1].first->GetShortName().c_str(), rule->unparse());
} }
tmp[z1].first->ClearTemplateClones(); tmp[z1].first->ClearTemplateClones();
@@ -2575,7 +2575,7 @@ void runPass(const int curr_regime, const char *proj_name, const char *folderNam
if (tmpFolder != "" && consoleMode) if (tmpFolder != "" && consoleMode)
folderName = NULL; folderName = NULL;
if (consoleMode) if (consoleMode && withTemplateInfo)
fclose(templatesInfo); fclose(templatesInfo);
} }
} }
@@ -2760,7 +2760,9 @@ int main(int argc, char **argv)
SPEED = 100; SPEED = 100;
} }
} }
else if (curr_arg[1] == 't') // deprecated else if (string(curr_arg) == "-tinfo")
withTemplateInfo = true;
else if (string(curr_arg) == "-t") // deprecated
{ {
i++; i++;
int par = atoi(argv[i]); int par = atoi(argv[i]);

View File

@@ -45,6 +45,7 @@ int debSh = 0; // shadow optimization debugging
bool ignoreArrayDistributeState = false; bool ignoreArrayDistributeState = false;
bool fullDepGraph = false; bool fullDepGraph = false;
bool noLogo = false; bool noLogo = false;
bool withTemplateInfo = false;
uint64_t currentAvailMemory = 0; uint64_t currentAvailMemory = 0;
int QUALITY; // quality of conflicts search in graph int QUALITY; // quality of conflicts search in graph

View File

@@ -1,3 +1,3 @@
#pragma once #pragma once
#define VERSION_SPF "2223" #define VERSION_SPF "2224"