Changeset 4729


Ignore:
Timestamp:
Aug 17, 2015, 1:13:09 PM (4 years ago)
Author:
cameron
Message:

Bug fix for SequentialFullyPackedStrategy?

File:
1 edited

Legend:

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

    r4726 r4729  
    4747    unsigned scopeCount = doScopeCount(pb);
    4848    mCarryInfoVector.resize(scopeCount);
    49     unsigned totalCarryDataSize = enumerate(pb, 0, 0);
    50    
    51     unsigned totalPackCount = (totalCarryDataSize + mITEMS_PER_PACK - 1)/mITEMS_PER_PACK;
    52 
    53     mCarryPackPtr.resize(totalPackCount);
    54     mCarryInPack.resize(totalPackCount);
    55     mCarryOutPack.resize(totalPackCount);
    56     for (auto i = 0; i < totalPackCount; i++) mCarryInPack[i]=nullptr;
    57 
    5849    if (Strategy == SequentialFullyPackedStrategy) {
    5950        mPACK_SIZE = 64;
     
    6253        mZeroInitializer = mBuilder->getInt64(0);
    6354        mOneInitializer = mBuilder->getInt64(-1);
    64         mTotalCarryDataBitBlocks = (totalCarryDataSize + BLOCK_SIZE - 1)/BLOCK_SIZE;
    65        
    6655    }
    6756    else {
     
    6958        mITEMS_PER_PACK = 1;
    7059        mCarryPackType = mBitBlockType;
     60    }
     61    unsigned totalCarryDataSize = enumerate(pb, 0, 0);
     62   
     63    unsigned totalPackCount = (totalCarryDataSize + mITEMS_PER_PACK - 1)/mITEMS_PER_PACK;
     64
     65    mCarryPackPtr.resize(totalPackCount);
     66    mCarryInPack.resize(totalPackCount);
     67    mCarryOutPack.resize(totalPackCount);
     68    for (auto i = 0; i < totalPackCount; i++) mCarryInPack[i]=nullptr;
     69
     70    if (Strategy == SequentialFullyPackedStrategy) {
     71        mTotalCarryDataBitBlocks = (totalCarryDataSize + BLOCK_SIZE - 1)/BLOCK_SIZE;       
     72    }
     73    else {
    7174        mTotalCarryDataBitBlocks = totalCarryDataSize;
    7275    }
     
    580583            carry_summary = mCarryOutPack[localCarryIndex];
    581584            for (auto i = 1; i < localCarryPacks; i++) {
    582                 //carry_summary = mBuilder->CreateOr(carry_summary, mPabloBlock->mCarryOutPack[i]);           
    583585                carry_summary = mBuilder->CreateOr(carry_summary, mCarryOutPack[localCarryIndex+i]);
    584586            }
Note: See TracChangeset for help on using the changeset viewer.