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

Use kernel state methods.

File:
1 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
Note: See TracChangeset for help on using the changeset viewer.