#pragma once #include #include #include "../Utils/json.hpp" typedef enum lang : int { LANG_C, LANG_F } language; typedef enum dist : int { BLOCK, NONE } distType; typedef std::pair, std::pair> attrType; namespace Distribution { class Array; } namespace DIST = Distribution; struct Directive { lang langType; std::string file; int line; int col; Directive () { #if __SPF langType = LANG_F; #else langType = LANG_C; #endif file = ""; line = 0; col = 0; } Directive(const Directive &dir) { langType = dir.langType; file = dir.file; line = dir.line; col = dir.col; } }; struct AlignRuleBase { public: static const std::vector alignNames; public: std::string GenRuleBase() const; nlohmann::json toJson(); public: DIST::Array *alignArray; DIST::Array *alignWith; std::vector> alignRule; std::vector>> alignRuleWith; }; struct DistrVariantBase { public: std::vector distRule; public: DistrVariantBase(const std::vector &distRule) : distRule(distRule) { } std::string GenRuleBase(const std::vector &newOrder) const; }; bool needCorner(const DIST::Array* currArray, const std::vector, int>>& shiftsByAccess, const std::vector>>& refsInLoop);