2023-09-14 19:43:13 +03:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
|
|
#include <string>
|
|
|
|
|
#include <set>
|
|
|
|
|
#include <map>
|
|
|
|
|
|
|
|
|
|
#include "../Utils/AstWrapper.h"
|
|
|
|
|
#include "../GraphLoop/graph_loops.h"
|
|
|
|
|
#include "../Distribution/DvmhDirective.h"
|
|
|
|
|
|
2024-11-14 12:37:38 +03:00
|
|
|
struct DvmDirective
|
|
|
|
|
{
|
|
|
|
|
std::set<Symbol*> corners;
|
|
|
|
|
std::vector<std::pair<std::pair<Symbol*, std::string>, std::vector<std::pair<int, int>>>> shadowRenew, across;
|
|
|
|
|
std::map<std::pair<std::pair<std::string, std::string>, std::string>, Expression*> remoteAccess;
|
|
|
|
|
|
|
|
|
|
std::map<std::string, std::set<Symbol*>> reduction;
|
|
|
|
|
std::map<std::string, std::set<std::tuple<Symbol*, Symbol*, int>>> reductionLoc;
|
|
|
|
|
};
|
|
|
|
|
|
2023-09-14 19:43:13 +03:00
|
|
|
bool isSPF_NoInline(Statement *stPrev);
|
|
|
|
|
|
|
|
|
|
template<typename fillType>
|
2024-04-09 16:41:48 +03:00
|
|
|
void fillPrivatesFromComment(Statement *st, std::set<fillType> &privates, int type = -1);
|
2023-09-14 19:43:13 +03:00
|
|
|
|
|
|
|
|
template<typename fillType>
|
2024-11-14 12:37:38 +03:00
|
|
|
void fillReductionsFromComment(Statement *st, std::map<std::string, std::set<fillType>> &reduction, bool moduleNameAdd = false, int type = SPF_ANALYSIS_DIR);
|
2023-09-14 19:43:13 +03:00
|
|
|
|
|
|
|
|
template<typename fillType>
|
2024-11-14 12:37:38 +03:00
|
|
|
void fillReductionsFromComment(Statement *st, std::map<std::string, std::set<std::tuple<fillType, fillType, int>>> &reduction, bool moduleNameAdd = false, int type = SPF_ANALYSIS_DIR);
|
2023-09-14 19:43:13 +03:00
|
|
|
|
|
|
|
|
void fillParameterFromComment(Statement *st, std::vector<std::pair<Expression*, Expression*>> &assigns);
|
|
|
|
|
|
|
|
|
|
template<typename fillType>
|
|
|
|
|
void fillShadowAcrossFromComment(const int type, Statement *st, std::vector<std::pair<std::pair<fillType, std::string>, std::vector<std::pair<int, int>>>> &data);
|
|
|
|
|
|
|
|
|
|
template<typename fillType>
|
|
|
|
|
void fillShadowAcrossFromParallel(const int type, Statement *st, std::vector<std::pair<std::pair<fillType, std::string>, std::vector<std::pair<int, int>>>> &data, std::set<fillType> &corner);
|
|
|
|
|
|
|
|
|
|
template<typename fillType>
|
|
|
|
|
void fillRemoteFromComment(Statement *st, std::map<std::pair<fillType, std::string>, Expression*> &remote, bool isFull = false, int type = SPF_PARALLEL_DIR);
|
|
|
|
|
|
|
|
|
|
void fillAcrossInfoFromDirectives(const LoopGraph *loopInfo, std::vector<std::pair<std::pair<std::string, std::string>, std::vector<std::pair<int, int>>>> &acrossInfo);
|
|
|
|
|
void fillInfoFromDirectives(const LoopGraph *loopInfo, ParallelDirective *directive);
|
2024-11-14 12:37:38 +03:00
|
|
|
void fillInfoFromDirective(Statement* parallel_on, DvmDirective& directive);
|
2023-09-14 19:43:13 +03:00
|
|
|
|
|
|
|
|
void fillFissionPrivatesExpansionFromComment(Statement *stIn, std::vector<std::string> &vars);
|
|
|
|
|
|
|
|
|
|
template<typename fillType>
|
|
|
|
|
void fillShrinkFromComment(Statement *stIn, std::vector<std::pair<fillType, std::vector<int>>> &varDims);
|
|
|
|
|
|
|
|
|
|
template<typename fillType>
|
|
|
|
|
void fillCheckpointFromComment(Statement *stIn, std::map<int, Expression*> &clauses, std::set<fillType> &vars, std::set<fillType> &expt);
|
2024-04-09 16:41:48 +03:00
|
|
|
|
|
|
|
|
int getCoverPropertyFromComment(Statement* stIn);
|