Ignore:
Timestamp:
Feb 18, 2017, 6:19:02 PM (3 years ago)
Author:
cameron
Message:

Make circular copyback testing available for all block-oriented kernels

File:
1 edited

Legend:

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

    r5328 r5330  
    173173    Value * i16UnitsFinal = iBuilder->CreateAdd(i16UnitsGenerated, iBuilder->CreateZExt(offset, iBuilder->getSizeTy()));
    174174    setProducedItemCount("i16Stream", i16UnitsFinal);
    175     const auto b  = getOutputStreamSetBuffer("i16Stream");
    176 
    177     if (auto cb = dyn_cast<CircularCopybackBuffer>(b)) {
    178         BasicBlock * copyBack = CreateBasicBlock("copyBack");
    179         BasicBlock * p2sCompressDone = CreateBasicBlock("p2sCompressDone");
    180        
    181         // Check for overflow into the buffer overflow area and copy data back if so.
    182         Value * accessible = cb->getLinearlyAccessibleItems(i16UnitsGenerated);
    183         offset = iBuilder->CreateZExt(offset, iBuilder->getSizeTy());
    184         Value * wraparound = iBuilder->CreateICmpULT(accessible, offset);
    185         iBuilder->CreateCondBr(wraparound, copyBack, p2sCompressDone);
    186        
    187         iBuilder->SetInsertPoint(copyBack);
    188         Value * copyItems = iBuilder->CreateSub(offset, accessible);
    189         cb->createCopyBack(getStreamSetBufferPtr("i16Stream"), copyItems);
    190         iBuilder->CreateBr(p2sCompressDone);
    191         iBuilder->SetInsertPoint(p2sCompressDone);
    192     }
    193175}
    194176   
Note: See TracChangeset for help on using the changeset viewer.