Ignore:
Timestamp:
Feb 29, 2016, 3:09:51 PM (3 years ago)
Author:
lindanl
Message:

Use kernel state methods.

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

Legend:

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

    r4942 r4945  
    6868
    6969void CarryManager::initialize_setPtrs(KernelBuilder * kBuilder) {
    70    
    71     Value * cdArrayPtr = kBuilder->getKernelInternalStatePtr(mCdArrayIdx);
     70
     71    Value * kernelStuctParam = kBuilder->getKernelStructParam();
     72    Value * cdArrayPtr = kBuilder->getKernelInternalStatePtr(kernelStuctParam, mCdArrayIdx);
    7273 
    7374    mCarryPackBasePtr = iBuilder->CreateBitCast(cdArrayPtr, PointerType::get(mCarryPackType, 0));
    74     mCarryBitBlockPtr = iBuilder->CreateBitCast(cdArrayPtr, PointerType::get(mBitBlockType, 0));
    75    
     75    mCarryBitBlockPtr = iBuilder->CreateBitCast(cdArrayPtr, PointerType::get(mBitBlockType, 0));   
    7676   
    7777    if (mPabloCountCount > 0) {
    78         Value * pcArrayPtr = kBuilder->getKernelInternalStatePtr(mPcArrayIdx);
     78        Value * pcArrayPtr = kBuilder->getKernelInternalStatePtr(kernelStuctParam, mPcArrayIdx);
    7979        mPopcountBasePtr = iBuilder->CreateBitCast(pcArrayPtr, Type::getInt64PtrTy(iBuilder->getContext()));
    8080    }
    8181 
    82     mBlockNo = iBuilder->CreateUDiv(kBuilder->getKernelInternalState(mFilePosIdx), iBuilder->getInt64(mBitBlockWidth));
     82    mBlockNo = iBuilder->CreateUDiv(kBuilder->getKernelInternalState(kernelStuctParam, mFilePosIdx), iBuilder->getInt64(mBitBlockWidth));
    8383    mCurrentScope = mRootScope;
    8484    mCurrentFrameIndex = 0;
     
    8888
    8989void CarryManager::set_BlockNo(KernelBuilder * kBuilder){
    90     mBlockNo = iBuilder->CreateUDiv(kBuilder->getKernelInternalState(mFilePosIdx), iBuilder->getInt64(mBitBlockWidth));
     90    Value * kernelStuctParam = kBuilder->getKernelStructParam();
     91    mBlockNo = iBuilder->CreateUDiv(kBuilder->getKernelInternalState(kernelStuctParam, mFilePosIdx), iBuilder->getInt64(mBitBlockWidth));
    9192}
    9293
  • icGREP/icgrep-devel/icgrep/pablo/pablo_compiler.cpp

    r4942 r4945  
    149149    struct Outputs outputs;
    150150    mFunction = mKBuilder->getDoBlockFunction();
     151    Value * kernelStuctParam = mKBuilder->getKernelStructParam();
    151152
    152153    mCarryManager->initialize_setPtrs(mKBuilder);
     
    160161        compileBlock(mainScope);
    161162
    162         Value * filePos = iBuilder->CreateAdd(mKBuilder->getKernelInternalState(mFilePosIdx), iBuilder->getInt64(iBuilder->getBitBlockWidth()));
    163         mKBuilder->changeKernelInternalState(mFilePosIdx, filePos);
     163        Value * filePos = iBuilder->CreateAdd(mKBuilder->getKernelInternalState(kernelStuctParam, mFilePosIdx), iBuilder->getInt64(iBuilder->getBitBlockWidth()));
     164        mKBuilder->changeKernelInternalState(kernelStuctParam, mFilePosIdx, filePos);
    164165
    165166        mCarryManager->set_BlockNo(mKBuilder);
Note: See TracChangeset for help on using the changeset viewer.