Ignore:
Timestamp:
Oct 25, 2017, 4:57:58 PM (20 months ago)
Author:
nmedfort
Message:

First stage of MultiBlockKernel? and pipeline restructuring

File:
1 edited

Legend:

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

    r5639 r5706  
    1414PDEPkernel::PDEPkernel(const std::unique_ptr<kernel::KernelBuilder> & kb, unsigned streamCount, unsigned swizzleFactor, unsigned PDEP_width)
    1515: MultiBlockKernel("PDEPdel",
    16                   {Binding{kb->getStreamSetTy(), "PDEPmarkerStream", MaxRatio(1)}, Binding{kb->getStreamSetTy(streamCount), "sourceStreamSet", MaxRatio(1)}},
     16                  {Binding{kb->getStreamSetTy(), "PDEPmarkerStream", BoundedRate(0, 1)},
     17                   Binding{kb->getStreamSetTy(streamCount), "sourceStreamSet", BoundedRate(0, 1)}},
    1718                  {Binding{kb->getStreamSetTy(streamCount), "outputStreamSet"}},
    1819                  {}, {}, {})
     
    2425}
    2526
    26 void PDEPkernel::generateMultiBlockLogic(const std::unique_ptr<KernelBuilder> & kb) {   
     27void PDEPkernel::generateMultiBlockLogic(const std::unique_ptr<KernelBuilder> & kb, Value * const numOfStrides) {
    2728    BasicBlock * entry = kb->GetInsertBlock();
    2829    BasicBlock * checkLoopCond = kb->CreateBasicBlock("checkLoopCond");
     
    3132    BasicBlock * terminate = kb->CreateBasicBlock("terminate");
    3233
    33     Function::arg_iterator args = mCurrentMethod->arg_begin();
    34     args++; //self
    35     Value * itemsToDo = &*(args++); // Since PDEP marker stream is a bit stream, this is the number of PDEP marker bits to process
    36     // Get pointer to start of the StreamSetBlock containing unprocessed input items.
    37     Value * sourceItemsAvail =  &*(args++);
    38     Value * PDEPStrmPtr = &*(args++);
    39     Value * inputSwizzlesPtr = &*(args++);
     34    Value * itemsToDo = mAvailableItemCount[0];
     35    Value * sourceItemsAvail = mAvailableItemCount[1];
     36
     37    Value * PDEPStrmPtr = iBuilder->getInputStreamBlockPtr("PDEPmarkerStream", iBuilder->getInt32(0)); // mStreamBufferPtr[0];
     38    Value * inputSwizzlesPtr = iBuilder->getInputStreamBlockPtr("sourceStreamSet", iBuilder->getInt32(0)); // mStreamBufferPtr[1];
    4039    // Get pointer to start of the output StreamSetBlock we're currently writing to
    41     Value * outputStreamPtr = &*(args);
     40    Value * outputStreamPtr = iBuilder->getOutputStreamBlockPtr("outputStreamSet", iBuilder->getInt32(0)); // mStreamBufferPtr[2];
    4241
    4342    Constant * blockWidth = kb->getSize(kb->getBitBlockWidth());
Note: See TracChangeset for help on using the changeset viewer.