Ignore:
Timestamp:
Aug 4, 2015, 7:06:55 AM (4 years ago)
Author:
cameron
Message:

Carry data/manager paramaterization: progress towards dynamic strategy selection.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • icGREP/icgrep-devel/icgrep/pablo/carry_manager.cpp

    r4713 r4714  
    9999            const unsigned ifCarryDataBits = enumerate(&ifStatement->getBody(), ifDepth+1, whileDepth);
    100100            PabloBlockCarryData * nestedBlockData = mCarryInfoVector[ifStatement->getBody().getScopeIndex()];
    101 #ifdef PACKING
    102             EnsurePackHasSpace(nestedOffset, ifCarryDataBits);
    103 #endif
     101            if (ITEMS_PER_PACK == PACK_SIZE) {  // PACKING
     102                if (cd->roomInFinalPack(nestedOffset) < ifCarryDataBits) {
     103                    nestedOffset = alignCeiling(nestedOffset, PACK_SIZE);
     104                }
     105            }
    104106            nestedBlockData->setFramePosition(nestedOffset);
    105107
     
    115117            PabloBlockCarryData * nestedBlockData = mCarryInfoVector[whileStatement->getBody().getScopeIndex()];
    116118            //if (whileStatement->isMultiCarry()) whileCarryDataBits *= whileStatement->getMaxIterations();
    117 #ifdef PACKING
    118             EnsurePackHasSpace(nestedOffset, whileCarryDataBits);
    119 #endif
     119            if (ITEMS_PER_PACK == PACK_SIZE) {  // PACKING
     120                if (cd->roomInFinalPack(nestedOffset) < whileCarryDataBits) {
     121                    nestedOffset = alignCeiling(nestedOffset, PACK_SIZE);
     122                }
     123            }
    120124            nestedBlockData->setFramePosition(nestedOffset);
    121125            nestedOffset += whileCarryDataBits;
     
    133137        // Need extra space for the summary variable, always the last
    134138        // entry within an if block.
    135 #ifdef PACKING
    136         cd->scopeCarryDataSize = alignCeiling(cd->scopeCarryDataSize, PACK_SIZE);
     139        if (ITEMS_PER_PACK == PACK_SIZE) {  // PACKING
     140            cd->scopeCarryDataSize = alignCeiling(cd->scopeCarryDataSize, PACK_SIZE);
     141        }
    137142        cd->summary.frameOffset = cd->scopeCarryDataSize;
    138         cd->scopeCarryDataSize += PACK_SIZE;
    139 #else
    140         cd->summary.frameOffset = cd->scopeCarryDataSize;
    141         cd->scopeCarryDataSize++;
    142 #endif
     143        cd->scopeCarryDataSize += ITEMS_PER_PACK;  //  computed summary is a full pack.
    143144    }
    144145    else {
Note: See TracChangeset for help on using the changeset viewer.