Changeset 5103 for icGREP/icgrep-devel


Ignore:
Timestamp:
Jul 20, 2016, 2:48:37 PM (3 years ago)
Author:
cameron
Message:

Clean out hard-coded circular buffer

Location:
icGREP/icgrep-devel/icgrep/kernels
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • icGREP/icgrep-devel/icgrep/kernels/interface.cpp

    r5100 r5103  
    156156    for (auto b : inputBuffers) {
    157157        init_args.push_back(b->getStreamSetBasePtr());
    158         init_args.push_back(iBuilder->getInt64(b->getBufferSize() - 1));
    159158    }
    160159    for (auto b : outputBuffers) {
    161160        init_args.push_back(b->getStreamSetBasePtr());
    162         init_args.push_back(iBuilder->getInt64(b->getBufferSize() - 1));
    163161    }
    164162    std::string initFnName = mKernelName + init_suffix;
  • icGREP/icgrep-devel/icgrep/kernels/kernel.cpp

    r5102 r5103  
    4040    for (auto sSet : mStreamSetInputs) {
    4141        mScalarInputs.push_back(ScalarBinding{PointerType::get(sSet.ssType.getStreamSetBlockType(), 0), sSet.ssName + basePtrSuffix});
    42         mScalarInputs.push_back(ScalarBinding{iBuilder->getInt64Ty(), sSet.ssName + blkMaskSuffix});
    43         //Or possibly add as internal state, with code in init function:  addScalar(iBuilder->getInt64Ty(), sSet.ssName + blkMaskSuffix);
    4442    }
    4543    for (auto sSet : mStreamSetOutputs) {
    4644        mScalarInputs.push_back(ScalarBinding{PointerType::get(sSet.ssType.getStreamSetBlockType(), 0), sSet.ssName + basePtrSuffix});
    47         mScalarInputs.push_back(ScalarBinding{iBuilder->getInt64Ty(), sSet.ssName + blkMaskSuffix});
    48         //Or possibly add as internal state, with code in init function:  addScalar(iBuilder->getInt64Ty(), sSet.ssName + blkMaskSuffix);
    4945    }
    5046    for (auto binding : mScalarInputs) {
     
    190186    }
    191187    iBuilder->restoreIP(savePoint);
    192     //doSegmentFunction->dump();
    193 }
    194 
    195 
     188}
    196189
    197190Value * KernelBuilder::getScalarIndex(std::string fieldName) {
     
    222215}
    223216
    224 Value * KernelBuilder::getCircularBufferBlockPointer(Value * self, std::string streamName, Value * blockNo) {
    225     Value * bufferBase = getScalarField(self, streamName + basePtrSuffix);
    226     Value * blockMask = getScalarField(self, streamName + blkMaskSuffix);
    227     return iBuilder->CreateGEP(bufferBase, iBuilder->CreateAnd(blockNo, blockMask));
    228 }
    229 
    230 
    231 
     217
  • icGREP/icgrep-devel/icgrep/kernels/kernel.h

    r5099 r5103  
    9292    // Get a parameter by name.
    9393    llvm::Value * getParameter(llvm::Function * f, std::string paramName);
    94    
    95     // Helper.
    96     Value * getCircularBufferBlockPointer(llvm::Value * self, std::string streamName, llvm::Value * blockNo);
    97 
    9894
    9995protected:
  • icGREP/icgrep-devel/icgrep/kernels/s2p_kernel.cpp

    r5102 r5103  
    147147    iBuilder->SetInsertPoint(finalEmptyBlock);
    148148    Value * blockNo = getScalarField(self, blockNoScalar);
    149     Value * basisBitsBlock_ptr = getCircularBufferBlockPointer(self, mStreamSetOutputs[0].ssName, blockNo);   
     149    Value * basisBitsBase_ptr = getScalarField(self, mStreamSetOutputs[0].ssName + basePtrSuffix);
     150    Value * basisBitsBlock_ptr = mStreamSetOutputs[0].ssType.getStreamSetBlockPointer(basisBitsBase_ptr, blockNo);
    150151    iBuilder->CreateStore(Constant::getNullValue(basisBitsBlock_ptr->getType()->getPointerElementType()), basisBitsBlock_ptr);
    151152    iBuilder->CreateBr(exitBlock);
  • icGREP/icgrep-devel/icgrep/kernels/scanmatchgen.cpp

    r5096 r5103  
    5757    Value * recordStart = getScalarField(kernelStuctParam, "LineStart");
    5858    Value * recordNum = getScalarField(kernelStuctParam, "LineNum");
    59    
    60     Value * matchResultsPtr = getCircularBufferBlockPointer(kernelStuctParam, "matchResults", blockNo);
    61    
     59    Value * matchResultsBase_ptr = getScalarField(kernelStuctParam, "matchResults" + basePtrSuffix);
     60    Value * matchResultsPtr = mStreamSetInputs[0].ssType.getStreamSetBlockPointer(matchResultsBase_ptr, blockNo);   
    6261    Value * matches = iBuilder->CreateBlockAlignedLoad(matchResultsPtr, {iBuilder->getInt32(0), iBuilder->getInt32(0)});
    6362    Value * linebreaks = iBuilder->CreateBlockAlignedLoad(matchResultsPtr, {iBuilder->getInt32(0), iBuilder->getInt32(1)});
Note: See TracChangeset for help on using the changeset viewer.