Ignore:
Timestamp:
Aug 5, 2015, 11:47:53 AM (4 years ago)
Author:
cameron
Message:

Dynamic selection of carry strategy options

File:
1 edited

Legend:

Unmodified
Added
Removed
  • icGREP/icgrep-devel/icgrep/pablo/carry_data.h

    r4714 r4715  
    2626unsigned const LongAdvanceBase = 64;
    2727
    28 //#define PACKING
    29 
    30 #ifdef PACKING
    31 const unsigned PACK_SIZE = 64;
    32 const unsigned ITEMS_PER_PACK = PACK_SIZE;
    33 #else
    34 const unsigned PACK_SIZE = BLOCK_SIZE;
    35 const unsigned ITEMS_PER_PACK = 1;
    36 #endif
    37 const unsigned POSITIONS_PER_BLOCK = ITEMS_PER_PACK * (BLOCK_SIZE/PACK_SIZE);
    38 
    3928
    4029static unsigned power2ceil (unsigned v) {
     
    5847class PabloBlockCarryData {
    5948public:
    60     PabloBlockCarryData(PabloBlock * b):
     49    PabloBlockCarryData(PabloBlock * b, unsigned PACK_SIZE, unsigned ITEMS_PER_PACK):
     50                           mPACK_SIZE(PACK_SIZE),
     51                           mITEMS_PER_PACK(ITEMS_PER_PACK),
     52                           mPOSITIONS_PER_BLOCK(mITEMS_PER_PACK * (BLOCK_SIZE/mPACK_SIZE)),
    6153                           theScope(b), framePosition(0),
    6254                           ifDepth(0), whileDepth (0), maxNestingDepth(0),
     
    7365   
    7466    inline unsigned roomInFinalPack(unsigned allocatedBits) {
    75         return ITEMS_PER_PACK - (allocatedBits % ITEMS_PER_PACK);
     67        return mITEMS_PER_PACK - (allocatedBits % mITEMS_PER_PACK);
    7668    }
    7769   
     
    114106   
    115107    unsigned getLocalCarryPackIndex () {
    116         return shortAdvance.frameOffset / ITEMS_PER_PACK;
     108        return shortAdvance.frameOffset / mITEMS_PER_PACK;
    117109    }
    118110
    119     unsigned getLocalCarryPackCount () { 
    120         return fullOrPartialBlocks(nested.frameOffset, ITEMS_PER_PACK) - shortAdvance.frameOffset / ITEMS_PER_PACK;
     111    unsigned getLocalCarryPackCount () {
     112        return fullOrPartialBlocks(nested.frameOffset, mITEMS_PER_PACK) - shortAdvance.frameOffset / mITEMS_PER_PACK;
    121113    }
    122114   
    123115    unsigned getScopeCarryPackCount () {
    124         return fullOrPartialBlocks(scopeCarryDataSize, ITEMS_PER_PACK);
     116        return fullOrPartialBlocks(scopeCarryDataSize, mITEMS_PER_PACK);
    125117    }
    126118   
     
    128120   
    129121    bool explicitSummaryRequired() const {
    130         return (ifDepth > 0) && (scopeCarryDataSize > ITEMS_PER_PACK);
     122        return (ifDepth > 0) && (scopeCarryDataSize > mITEMS_PER_PACK);
    131123    }
    132124   
    133125protected:
     126   
     127    unsigned mPACK_SIZE, mITEMS_PER_PACK, mPOSITIONS_PER_BLOCK;
    134128   
    135129    PabloBlock * theScope;
Note: See TracChangeset for help on using the changeset viewer.