Changeset 5097


Ignore:
Timestamp:
Jul 17, 2016, 12:11:52 PM (3 years ago)
Author:
cameron
Message:

Kernel/interface progress

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

Legend:

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

    r5074 r5097  
    5757    iBuilder->SetInsertPoint(BasicBlock::Create(iBuilder->getContext(), "entry", doBlockFunction, 0));
    5858   
    59     Value * inputStreamBlock = getParameter(doBlockFunction, "inputStreamSet");
    60     Value * outputStreamBlock = getParameter(doBlockFunction, "outputStreamSet");
    61     Value * delCountBlock = getParameter(doBlockFunction, "deletionCounts");
     59    Value * self = getParameter(doBlockFunction, "self");
     60   
     61    Value * blockNo = getScalarField(self, blockNoScalar);
     62    Value * inputStreamBlock = getCircularBufferBlockPointer(self, "inputStreamSet", blockNo);
     63    Value * outputStreamBlock = getCircularBufferBlockPointer(self, "outputStreamSet", blockNo);
     64    Value * delCountBlock = getCircularBufferBlockPointer(self, "deletionCounts", blockNo);
    6265   
    6366    Value * del_mask = iBuilder->CreateBlockAlignedLoad(inputStreamBlock, {iBuilder->getInt32(0), iBuilder->getInt32(mStreamCount)});
     
    8790    iBuilder->SetInsertPoint(BasicBlock::Create(iBuilder->getContext(), "entry", finalBlockFunction, 0));
    8891    Value * remainingBytes = getParameter(finalBlockFunction, "remainingBytes");
    89     Value * inputStreamBlock = getParameter(finalBlockFunction, "inputStreamSet");
     92    Value * self = getParameter(doBlockFunction, "self");
     93    Value * blockNo = getScalarField(self, blockNoScalar);
     94    Value * inputStreamBlock = getCircularBufferBlockPointer(self, "inputStreamSet", blockNo);
    9095    Value * remaining = iBuilder->CreateZExt(remainingBytes, iBuilder->getIntNTy(blockSize));
    9196    Value * EOF_del = iBuilder->bitCast(iBuilder->CreateShl(Constant::getAllOnesValue(iBuilder->getIntNTy(blockSize)), remaining));
     
    9398    Value * const delmaskVal = iBuilder->CreateBlockAlignedLoad(delmaskPtr);
    9499    iBuilder->CreateBlockAlignedStore(iBuilder->CreateOr(EOF_del, delmaskVal), delmaskPtr);
    95     Function::arg_iterator args = finalBlockFunction->arg_begin();
    96     Value * self = &*(args++);
    97     /* Skip "remaining" arg */ args++;
    98     std::vector<Value *> doBlockArgs = {self};
    99     while (args != finalBlockFunction->arg_end()){
    100         doBlockArgs.push_back(&*args++);
    101     }
    102     iBuilder->CreateCall(doBlockFunction, doBlockArgs);   
     100    iBuilder->CreateCall(doBlockFunction, {self});
    103101    iBuilder->CreateRetVoid();
    104102    iBuilder->restoreIP(savePoint);
  • icGREP/icgrep-devel/icgrep/kernels/interface.h

    r5096 r5097  
    6262    llvm::Value * createGetAccumulatorCall(llvm::Value * kernelInstance, std::string accumName);
    6363   
    64 //protected:
     64protected:
    6565   
    6666    IDISA::IDISA_Builder * iBuilder;
  • icGREP/icgrep-devel/icgrep/kernels/kernel.h

    r5096 r5097  
    4141    void generateKernel();
    4242   
    43 //protected:
     43protected:
    4444    //
    4545    // Kernel builder subtypes define their logic of kernel construction
     
    9797
    9898
    99 //protected:
     99protected:
    100100
    101101    std::vector<llvm::Type *>  mKernelFields;
  • icGREP/icgrep-devel/icgrep/kernels/p2s_kernel.cpp

    r5079 r5097  
    4949    iBuilder->SetInsertPoint(BasicBlock::Create(iBuilder->getContext(), "entry", doBlockFunction, 0));
    5050   
    51     Value * basisBitsBlock_ptr = getParameter(doBlockFunction, "basisBits");  // input
    52     Value * byteStreamBlock_ptr = getParameter(doBlockFunction, "byteStream"); // output
     51    Value * self = getParameter(doBlockFunction, "self");
     52    Value * blockNo = getScalarField(self, blockNoScalar);
     53    Value * basisBitsBlock_ptr = getCircularBufferBlockPointer(self, "basisBits", blockNo);
     54    Value * byteStreamBlock_ptr = getCircularBufferBlockPointer(self, "byteStream", blockNo);
     55
    5356    Value * p_bitblock[8];
    5457    for (unsigned i = 0; i < 8; i++) {
     
    8184    iBuilder->SetInsertPoint(BasicBlock::Create(iBuilder->getContext(), "entry", doBlockFunction, 0));
    8285   
    83     Value * basisBitsBlock_ptr = getParameter(doBlockFunction, "basisBits");  // input
    84     Value * delCountBlock_ptr = getParameter(doBlockFunction, "deletionCounts");
    85     Value * byteStreamBlock_ptr = getParameter(doBlockFunction, "byteStream"); // output
    86    
     86   
     87    Value * self = getParameter(doBlockFunction, "self");
     88    Value * blockNo = getScalarField(self, blockNoScalar);
     89    Value * basisBitsBlock_ptr = getCircularBufferBlockPointer(self, "basisBits", blockNo);
     90    Value * delCountBlock_ptr = getCircularBufferBlockPointer(self, "deletionCounts", blockNo);
     91    Value * byteStreamBlock_ptr = getCircularBufferBlockPointer(self, "byteStream", blockNo);
     92
    8793    Value * p_bitblock[8];
    8894    for (unsigned i = 0; i < 8; i++) {
     
    116122    iBuilder->SetInsertPoint(BasicBlock::Create(iBuilder->getContext(), "entry", doBlockFunction, 0));
    117123   
    118     Value * basisBitsBlock_ptr = getParameter(doBlockFunction, "basisBits");  // input
    119     Value * i16StreamBlock_ptr = getParameter(doBlockFunction, "i16Stream"); // output
     124    Value * self = getParameter(doBlockFunction, "self");
     125    Value * blockNo = getScalarField(self, blockNoScalar);
     126    Value * basisBitsBlock_ptr = getCircularBufferBlockPointer(self, "basisBits", blockNo);
     127    Value * i16StreamBlock_ptr = getCircularBufferBlockPointer(self, "i16Stream", blockNo);
    120128   
    121129    Value * hi_input[8];
     
    159167    iBuilder->SetInsertPoint(BasicBlock::Create(iBuilder->getContext(), "entry", doBlockFunction, 0));
    160168   
    161     Value * basisBitsBlock_ptr = getParameter(doBlockFunction, "basisBits");  // input
    162     Value * delCountBlock_ptr = getParameter(doBlockFunction, "deletionCounts");
    163     Value * i16StreamBlock_ptr = getParameter(doBlockFunction, "i16Stream"); // output
     169    Value * self = getParameter(doBlockFunction, "self");
     170    Value * blockNo = getScalarField(self, blockNoScalar);
     171    Value * basisBitsBlock_ptr = getCircularBufferBlockPointer(self, "basisBits", blockNo);
     172    Value * delCountBlock_ptr = getCircularBufferBlockPointer(self, "deletionCounts", blockNo);
     173    Value * i16StreamBlock_ptr = getCircularBufferBlockPointer(self, "i16Stream", blockNo);
    164174
    165175    Value * hi_input[8];
  • icGREP/icgrep-devel/icgrep/kernels/s2p_kernel.cpp

    r5096 r5097  
    166166   
    167167    Value * self = getParameter(doBlockFunction, "self");
    168 
    169168    Value * blockNo = getScalarField(self, blockNoScalar);
    170169    Value * byteStreamBlock_ptr = getCircularBufferBlockPointer(self, mStreamSetInputs[0].ssName, blockNo);
  • icGREP/icgrep-devel/icgrep/kernels/stdout_kernel.cpp

    r5076 r5097  
    3838
    3939    Value * self = getParameter(doBlockFunction, "self");
     40    Value * blockNo = getScalarField(self, blockNoScalar);
     41    Value * inputStreamBlock = getCircularBufferBlockPointer(self, "inputStreamSet", blockNo);
     42
    4043    Value * bufferPtr = getParameter(doBlockFunction, "bufferPtr");
    4144    Value * bufferFinalBlockPtr = getScalarField(self, "bufferFinalBlockPtr");
Note: See TracChangeset for help on using the changeset viewer.