Ignore:
Timestamp:
Dec 2, 2015, 4:22:23 PM (3 years ago)
Author:
nmedfort
Message:

Work on adding Multiplexing Window Size.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • icGREP/icgrep-devel/icgrep/pablo/optimizers/pablo_automultiplexing.hpp

    r4871 r4888  
    2020class PabloFunction;
    2121
    22 class AutoMultiplexing {
     22class MultiplexingPass {
    2323
    2424    using CharacterizationMap = llvm::DenseMap<const PabloAST *, BDD>;
     
    2929    using MultiplexSetGraph = boost::adjacency_list<boost::hash_setS, boost::vecS, boost::bidirectionalS>;
    3030    using SubsetGraph = boost::adjacency_list<boost::hash_setS, boost::vecS, boost::bidirectionalS>;
     31    using AdvanceDepth = std::vector<int>;
    3132    using AdvanceAttributes = std::vector<std::pair<Advance *, BDD>>; // the Advance pointer and its respective base BDD variable
    3233    using VertexVector = std::vector<ConstraintVertex>;
     
    3435
    3536public:
    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);
    3738protected:
    3839    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
    3943    void characterize(PabloBlock * const block);
    4044    BDD characterize(Statement * const stmt);
    4145    BDD characterize(Advance * const adv, const BDD Ik);
    4246    bool independent(const ConstraintVertex i, const ConstraintVertex j) const;
     47    bool exceedsWindowSize(const ConstraintVertex i, const ConstraintVertex j) const;
    4348    bool generateCandidateSets(RNG & rng);
     49
    4450    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();
    4854    void multiplexSelectedIndependentSets(PabloFunction & function);
    4955    static void topologicalSort(PabloFunction & function);
    5056    BDD & get(const PabloAST * const expr);
    5157
    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)
    5563    , mVariables(0)
    5664    , mConstraintGraph(0)
     65    , mAdvanceDepth(0, 0)
    5766    {
     67
    5868    }
    5969
    6070private:
    61     const unsigned              mLimit;
    62     const unsigned              mMaxSelections;
     71    const unsigned              mMultiplexingSetSizeLimit;
     72    const unsigned              mMaxMultiplexingSetSelections;
     73    const unsigned              mWindowSize;
     74    const bool                  mTestConstrainedAdvances;
    6375    unsigned                    mVariables;
    6476    CharacterizationMap         mCharacterization;
    6577    ConstraintGraph             mConstraintGraph;
     78    AdvanceDepth                mAdvanceDepth;
    6679    SubsetGraph                 mSubsetGraph;
    6780    AdvanceAttributes           mAdvanceAttributes;
Note: See TracChangeset for help on using the changeset viewer.