Ignore:
Timestamp:
Sep 28, 2017, 11:47:58 AM (21 months ago)
Author:
cameron
Message:

Multiblock kernel builder support for ExternalBuffer? inputs; clean-up

File:
1 edited

Legend:

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

    r5647 r5650  
    129129}
    130130
    131 Value * KernelBuilder::getLinearlyAccessibleItems(const std::string & name, Value * fromPosition) {
     131Value * KernelBuilder::getLinearlyAccessibleItems(const std::string & name, Value * fromPosition, Value * avail, bool reverse) {
    132132    Kernel::Port port; unsigned index;
    133133    std::tie(port, index) = mKernel->getStreamPort(name);
    134134    const StreamSetBuffer * buf = nullptr;
    135     if (port == Kernel::Port::Input) {       
     135    if (port == Kernel::Port::Input) {
    136136        const auto lookAhead = mKernel->getLookAhead(index);
    137137        if (LLVM_UNLIKELY(lookAhead != 0)) {
     
    143143    }
    144144    assert (buf);
    145     return buf->getLinearlyAccessibleItems(this, getStreamSetBufferPtr(name), fromPosition);
    146 }
    147 
    148 Value * KernelBuilder::getLinearlyAccessibleBlocks(const std::string & name, Value * fromBlock) {
    149     Kernel::Port port; unsigned index;
    150     std::tie(port, index) = mKernel->getStreamPort(name);
    151     const StreamSetBuffer * buf = nullptr;
    152     if (port == Kernel::Port::Input) {       
    153         const auto lookAhead = mKernel->getLookAhead(index);
    154         if (LLVM_UNLIKELY(lookAhead != 0)) {
    155             const auto blocksAhead = (lookAhead + getBitBlockWidth() - 1) / getBitBlockWidth();
    156             fromBlock = CreateAdd(ConstantInt::get(fromBlock->getType(), blocksAhead), fromBlock);
    157         }
    158         buf = mKernel->getInputStreamSetBuffer(name);
    159     } else {
    160         buf = mKernel->getOutputStreamSetBuffer(name);
    161     }
    162     assert (buf);
    163     return buf->getLinearlyAccessibleBlocks(this, getStreamSetBufferPtr(name), fromBlock);
    164 }
    165 
    166 Value * KernelBuilder::getLinearlyWritableItems(const std::string & name, Value * fromPosition) {
    167     const StreamSetBuffer * const buf = mKernel->getOutputStreamSetBuffer(name);
    168     return buf->getLinearlyWritableItems(this, getStreamSetBufferPtr(name), fromPosition);
    169 }
    170 
    171 Value * KernelBuilder::getLinearlyWritableBlocks(const std::string & name, Value * fromBlock) {
    172     const StreamSetBuffer * const buf = mKernel->getOutputStreamSetBuffer(name);
    173     return buf->getLinearlyWritableBlocks(this, getStreamSetBufferPtr(name), fromBlock);
     145    return buf->getLinearlyAccessibleItems(this, getStreamSetBufferPtr(name), fromPosition, avail, reverse);
     146}
     147
     148Value * KernelBuilder::getLinearlyWritableItems(const std::string & name, Value * fromPosition, bool reverse) {
     149    const StreamSetBuffer * const buf = mKernel->getOutputStreamSetBuffer(name);
     150    return buf->getLinearlyWritableItems(this, getStreamSetBufferPtr(name), fromPosition, reverse);
    174151}
    175152
Note: See TracChangeset for help on using the changeset viewer.