Changeset 4713 for icGREP


Ignore:
Timestamp:
Aug 2, 2015, 8:12:17 AM (4 years ago)
Author:
cameron
Message:

Carry manager with bit packing now passes make check; cleanup

Location:
icGREP/icgrep-devel/icgrep/pablo
Files:
2 edited

Legend:

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

    r4704 r4713  
    3030#ifdef PACKING
    3131const unsigned PACK_SIZE = 64;
     32const unsigned ITEMS_PER_PACK = PACK_SIZE;
    3233#else
    3334const unsigned PACK_SIZE = BLOCK_SIZE;
     35const unsigned ITEMS_PER_PACK = 1;
    3436#endif
    3537
     
    117119   
    118120    unsigned getLocalCarryPackIndex () {
    119 #ifdef PACKING
    120         return shortAdvance.frameOffset / PACK_SIZE;
    121 #else
    122         return shortAdvance.frameOffset;
    123 #endif
     121        return shortAdvance.frameOffset / ITEMS_PER_PACK;
    124122    }
    125123
    126124    unsigned getLocalCarryPackCount () {
    127 #ifdef PACKING
    128         return fullOrPartialBlocks(nested.frameOffset, PACK_SIZE) - shortAdvance.frameOffset / PACK_SIZE;
    129 #else
    130         return nested.frameOffset - shortAdvance.frameOffset;
    131 #endif
     125        return fullOrPartialBlocks(nested.frameOffset, ITEMS_PER_PACK) - shortAdvance.frameOffset / ITEMS_PER_PACK;
    132126    }
    133127   
    134128    unsigned getScopeCarryPackCount () {
    135 #ifdef PACKING
    136         return fullOrPartialBlocks(scopeCarryDataSize, PACK_SIZE);
    137 #else
    138         return scopeCarryDataSize;
    139 #endif
     129        return fullOrPartialBlocks(scopeCarryDataSize, ITEMS_PER_PACK);
    140130    }
    141131   
     
    143133   
    144134    bool explicitSummaryRequired() const {
    145 #ifdef PACKING
    146         return (ifDepth > 0) && (scopeCarryDataSize > PACK_SIZE);
    147 #else
    148         return (ifDepth > 0) && (scopeCarryDataSize > 1);
    149 #endif
     135        return (ifDepth > 0) && (scopeCarryDataSize > ITEMS_PER_PACK);
    150136    }
    151137   
  • icGREP/icgrep-devel/icgrep/pablo/carry_manager.cpp

    r4712 r4713  
    145145        cd->summary.frameOffset = 0;
    146146    }
     147#ifndef NDEBUG
     148    if (cd->ifDepth == 0) cd->dumpCarryData(cerr);
     149#endif
    147150    return cd->scopeCarryDataSize;
    148151}
     
    648651}
    649652
    650 /* Store all the full carry packs generated locally in this scope. */
     653/* Store all the full carry packs generated locally in this scope or the
     654   single full pack for this scope*/
    651655void CarryManager::ensureCarriesStoredLocal() {
    652656#ifdef PACKING
    653     if ((mCurrentFrameIndex % PACK_SIZE) == 0) {
     657    const unsigned scopeCarryPacks = mCarryInfo->getScopeCarryPackCount();
     658    if ((scopeCarryPacks > 0) && ((mCurrentFrameIndex % PACK_SIZE) == 0)) {
     659        // We have carry data and we are not in the middle of a pack.
    654660        // Write out all local packs.
    655661        auto localCarryIndex = localBasePack();
     
    658664            storeCarryPack(i);
    659665        }
     666        if ((localCarryPacks == 0) && (scopeCarryPacks == 1) && (mCarryInfo->nested.entries > 1)) {
     667            storeCarryPack(localCarryIndex);
     668        }
    660669    }
    661670#endif
Note: See TracChangeset for help on using the changeset viewer.