- Timestamp:
- Dec 2, 2015, 4:22:23 PM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
icGREP/icgrep-devel/icgrep/pablo/optimizers/pablo_automultiplexing.hpp
r4871 r4888 20 20 class PabloFunction; 21 21 22 class AutoMultiplexing{22 class MultiplexingPass { 23 23 24 24 using CharacterizationMap = llvm::DenseMap<const PabloAST *, BDD>; … … 29 29 using MultiplexSetGraph = boost::adjacency_list<boost::hash_setS, boost::vecS, boost::bidirectionalS>; 30 30 using SubsetGraph = boost::adjacency_list<boost::hash_setS, boost::vecS, boost::bidirectionalS>; 31 using AdvanceDepth = std::vector<int>; 31 32 using AdvanceAttributes = std::vector<std::pair<Advance *, BDD>>; // the Advance pointer and its respective base BDD variable 32 33 using VertexVector = std::vector<ConstraintVertex>; … … 34 35 35 36 public: 36 static bool optimize(PabloFunction & function, const unsigned limit = std::numeric_limits<unsigned>::max(), const unsigned maxSelections = 100, const bool independent = false);37 static bool optimize(PabloFunction & function, const unsigned limit = std::numeric_limits<unsigned>::max(), const unsigned maxSelections = 100, const unsigned windowSize = 10, const bool independent = false); 37 38 protected: 38 39 unsigned initialize(PabloFunction & function, const bool independent); 40 void initializeBaseConstraintGraph(PabloBlock * const block, const unsigned statements, const unsigned advances); 41 void initializeAdvanceDepth(PabloBlock * const block, const unsigned advances) ; 42 39 43 void characterize(PabloBlock * const block); 40 44 BDD characterize(Statement * const stmt); 41 45 BDD characterize(Advance * const adv, const BDD Ik); 42 46 bool independent(const ConstraintVertex i, const ConstraintVertex j) const; 47 bool exceedsWindowSize(const ConstraintVertex i, const ConstraintVertex j) const; 43 48 bool generateCandidateSets(RNG & rng); 49 44 50 void addCandidateSet(const VertexVector & S, RNG & rng); 45 void selectMultiplexSets(RNG & );46 void doTransitiveReductionOfSubsetGraph() 47 void applySubsetConstraints();51 void selectMultiplexSets(RNG & rng); 52 void doTransitiveReductionOfSubsetGraph(); 53 void eliminateSubsetConstraints(); 48 54 void multiplexSelectedIndependentSets(PabloFunction & function); 49 55 static void topologicalSort(PabloFunction & function); 50 56 BDD & get(const PabloAST * const expr); 51 57 52 inline AutoMultiplexing(const unsigned limit, const unsigned maxSelections) 53 : mLimit(limit) 54 , mMaxSelections(maxSelections) 58 inline MultiplexingPass(const unsigned limit, const unsigned maxSelections, const unsigned windowSize) 59 : mMultiplexingSetSizeLimit(limit) 60 , mMaxMultiplexingSetSelections(maxSelections) 61 , mWindowSize(windowSize) 62 , mTestConstrainedAdvances(true) 55 63 , mVariables(0) 56 64 , mConstraintGraph(0) 65 , mAdvanceDepth(0, 0) 57 66 { 67 58 68 } 59 69 60 70 private: 61 const unsigned mLimit; 62 const unsigned mMaxSelections; 71 const unsigned mMultiplexingSetSizeLimit; 72 const unsigned mMaxMultiplexingSetSelections; 73 const unsigned mWindowSize; 74 const bool mTestConstrainedAdvances; 63 75 unsigned mVariables; 64 76 CharacterizationMap mCharacterization; 65 77 ConstraintGraph mConstraintGraph; 78 AdvanceDepth mAdvanceDepth; 66 79 SubsetGraph mSubsetGraph; 67 80 AdvanceAttributes mAdvanceAttributes;
Note: See TracChangeset
for help on using the changeset viewer.