Changeset 5501


Ignore:
Timestamp:
Jun 10, 2017, 2:11:39 PM (21 months ago)
Author:
cameron
Message:

setCapacity/getCapacity/getLinearlyAvailableItems for SourceBuffer?

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

Legend:

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

    r5497 r5501  
    520520            Value * priorOffset = idb->CreateAnd(priorProduced[priorIdx], idb->getSize(idb->getBitBlockWidth() - 1));
    521521            Value * instance = idb->getStreamSetBufferPtr(mStreamSetOutputs[i].name);
    522             Value * accessibleBlocks = cb->getLinearlyAccessibleBlocks(idb.get(), priorBlock);
     522            Value * accessibleBlocks = idb->getLinearlyAccessibleBlocks(mStreamSetOutputs[i].name, priorBlock);
    523523            Value * accessible = idb->CreateSub(idb->CreateShl(accessibleBlocks, log2BlockSize), priorOffset);
    524524            Value * wraparound = idb->CreateICmpULT(accessible, newlyProduced);
     
    536536            Value * instance = idb->getStreamSetBufferPtr(mStreamSetOutputs[i].name);
    537537            Value * newlyProduced = idb->CreateSub(idb->getProducedItemCount(mStreamSetOutputs[i].name), priorProduced[priorIdx]);
    538             Value * accessible = cb->getLinearlyAccessibleItems(idb.get(), priorProduced[priorIdx]);
     538            Value * accessible = idb->getLinearlyAccessibleItems(mStreamSetOutputs[i].name, priorProduced[priorIdx]);
    539539            Value * wraparound = idb->CreateICmpULT(accessible, newlyProduced);
    540540            idb->CreateCondBr(wraparound, copyBack, done);
     
    867867            Value * maxReferenceItems = nullptr;
    868868            if ((rate.isFixedRatio()) && (rate.getRatioNumerator() == rate.getRatioDenominator()) && (rate.referenceStreamSet() == "")) {
    869                 maxReferenceItems = kb->CreateMul(mStreamSetInputBuffers[i]->getLinearlyAccessibleBlocks(kb.get(), blkNo), blockSize);
     869                maxReferenceItems = kb->CreateMul(kb->getLinearlyAccessibleBlocks(mStreamSetInputs[i].name, blkNo), blockSize);
    870870            } else {
    871                 Value * linearlyAvailItems = mStreamSetInputBuffers[i]->getLinearlyAccessibleItems(kb.get(), p);
     871                Value * linearlyAvailItems = kb->getLinearlyAccessibleItems(mStreamSetInputs[i].name, p);
    872872                maxReferenceItems = rate.CreateMaxReferenceItemsCalculation(kb.get(), linearlyAvailItems);
    873873            }
     
    890890            Value * maxReferenceItems = nullptr;
    891891            if ((rate.isFixedRatio()) && (rate.getRatioNumerator() == rate.getRatioDenominator())) {
    892                 maxReferenceItems = kb->CreateMul(mStreamSetOutputBuffers[0]->getLinearlyWritableBlocks(kb.get(), blkNo), blockSize);
     892                maxReferenceItems = kb->CreateMul(kb->getLinearlyWritableBlocks(mStreamSetOutputs[i].name, blkNo), blockSize);
    893893            } else {
    894                 Value * writableItems = mStreamSetOutputBuffers[0]->getLinearlyWritableItems(kb.get(), p);
     894                Value * writableItems = kb->getLinearlyWritableItems(mStreamSetOutputs[i].name, p);
    895895                maxReferenceItems = rate.CreateMaxReferenceItemsCalculation(kb.get(), writableItems);
    896896            }
     
    915915        if (!isDerived[i]) {
    916916            Value * avail = kb->CreateSub(mAvailableItemCount[i], processedItemCount[i]);
    917             Value * linearlyAvail = mStreamSetInputBuffers[i]->getLinearlyAccessibleItems(kb.get(), processedItemCount[i]);
     917            Value * linearlyAvail = kb->getLinearlyAccessibleItems(mStreamSetInputs[i].name, processedItemCount[i]);
    918918            doMultiBlockArgs.push_back(kb->CreateSelect(kb->CreateICmpULT(avail, linearlyAvail), avail, linearlyAvail));
    919919        }
     
    942942            Value * priorOffset = kb->CreateAnd(producedItemCount[i], kb->getSize(kb->getBitBlockWidth() - 1));
    943943            Value * instance = kb->getStreamSetBufferPtr(mStreamSetOutputs[i].name);
    944             Value * accessibleBlocks = cb->getLinearlyAccessibleBlocks(kb.get(), priorBlock);
     944            Value * accessibleBlocks = kb->getLinearlyAccessibleBlocks(mStreamSetOutputs[i].name, priorBlock);
    945945            Value * accessible = kb->CreateSub(kb->CreateShl(accessibleBlocks, log2BlockSize), priorOffset);
    946946            Value * wraparound = kb->CreateICmpULT(accessible, newlyProduced);
     
    958958            Value * instance = kb->getStreamSetBufferPtr(mStreamSetOutputs[i].name);
    959959            Value * newlyProduced = kb->CreateSub(kb->getProducedItemCount(mStreamSetOutputs[i].name), producedItemCount[i]);
    960             Value * accessible = cb->getLinearlyAccessibleItems(kb.get(), producedItemCount[i]);
     960            Value * accessible = kb->getLinearlyAccessibleItems(mStreamSetOutputs[i].name, producedItemCount[i]);
    961961            Value * wraparound = kb->CreateICmpULT(accessible, newlyProduced);
    962962            kb->CreateCondBr(wraparound, copyBack, done);
     
    10501050            // Round up to exact multiple of block size.
    10511051            neededItems = kb->CreateAnd(kb->CreateAdd(neededItems, kb->getSize(bitBlockWidth - 1)), blockBaseMask);
    1052             Value * availFromBase = mStreamSetInputBuffers[i]->getLinearlyAccessibleItems(kb.get(), blockBasePos);
     1052            Value * availFromBase = kb->getLinearlyAccessibleItems(mStreamSetInputs[i].name, blockBasePos);
    10531053            Value * copyItems1 = kb->CreateSelect(kb->CreateICmpULT(neededItems, availFromBase), neededItems, availFromBase);
    10541054            Value * copyItems2 = kb->CreateSub(neededItems, copyItems1);
     
    10911091        // Round up to exact multiple of block size.
    10921092        copyItems = kb->CreateAnd(kb->CreateAdd(copyItems, kb->getSize(bitBlockWidth - 1)), blockBaseMask);
    1093         Value * writableFromBase = mStreamSetOutputBuffers[i]->getLinearlyWritableItems(kb.get(), blockBasePos[i]); // must be a whole number of blocks.
     1093        Value * writableFromBase = kb->getLinearlyWritableItems(mStreamSetOutputs[i].name, blockBasePos[i]); // must be a whole number of blocks.
    10941094        Value * copyItems1 = kb->CreateSelect(kb->CreateICmpULT(copyItems, writableFromBase), copyItems, writableFromBase);
    10951095        Value * copyBlocks1 = kb->CreateUDiv(copyItems1, blockSize);
  • icGREP/icgrep-devel/icgrep/kernels/kernel_builder.cpp

    r5493 r5501  
    129129
    130130Value * KernelBuilder::getLinearlyAccessibleItems(const std::string & name, Value * fromPosition) {
    131     const StreamSetBuffer * const buf = mKernel->getInputStreamSetBuffer(name);
    132     return buf->getLinearlyAccessibleItems(this, fromPosition);
     131    Kernel::Port port; unsigned index;
     132    std::tie(port, index) = mKernel->getStreamPort(name);
     133    if (port == Kernel::Port::Input) {
     134        const StreamSetBuffer * const buf = mKernel->getInputStreamSetBuffer(name);
     135        return buf->getLinearlyAccessibleItems(this, getStreamSetBufferPtr(name), fromPosition);
     136    }
     137    else {
     138        const StreamSetBuffer * const buf = mKernel->getOutputStreamSetBuffer(name);
     139        return buf->getLinearlyAccessibleItems(this, getStreamSetBufferPtr(name), fromPosition);
     140    }
     141}
     142
     143Value * KernelBuilder::getLinearlyAccessibleBlocks(const std::string & name, Value * fromBlock) {
     144    Kernel::Port port; unsigned index;
     145    std::tie(port, index) = mKernel->getStreamPort(name);
     146    if (port == Kernel::Port::Input) {
     147        const StreamSetBuffer * const buf = mKernel->getInputStreamSetBuffer(name);
     148        return buf->getLinearlyAccessibleBlocks(this, getStreamSetBufferPtr(name), fromBlock);
     149    } else {
     150        const StreamSetBuffer * const buf = mKernel->getOutputStreamSetBuffer(name);
     151        return buf->getLinearlyAccessibleBlocks(this, getStreamSetBufferPtr(name), fromBlock);
     152    }
     153}
     154
     155Value * KernelBuilder::getLinearlyWritableItems(const std::string & name, Value * fromPosition) {
     156    const StreamSetBuffer * const buf = mKernel->getOutputStreamSetBuffer(name);
     157    return buf->getLinearlyWritableItems(this, getStreamSetBufferPtr(name), fromPosition);
     158}
     159
     160Value * KernelBuilder::getLinearlyWritableBlocks(const std::string & name, Value * fromBlock) {
     161    const StreamSetBuffer * const buf = mKernel->getOutputStreamSetBuffer(name);
     162    return buf->getLinearlyWritableBlocks(this, getStreamSetBufferPtr(name), fromBlock);
    133163}
    134164
     
    233263
    234264
     265Value * KernelBuilder::getCapacity(const std::string & name) {
     266    return mKernel->getAnyStreamSetBuffer(name)->getCapacity(this, getStreamSetBufferPtr(name));
     267}
     268
     269void KernelBuilder::setCapacity(const std::string & name, Value * c) {
     270    mKernel->getAnyStreamSetBuffer(name)->setCapacity(this, getStreamSetBufferPtr(name), c);
     271}
     272
     273   
    235274CallInst * KernelBuilder::createDoSegmentCall(const std::vector<Value *> & args) {
    236275    Function * const doSegment = mKernel->getDoSegmentFunction(getModule());
  • icGREP/icgrep-devel/icgrep/kernels/kernel_builder.h

    r5493 r5501  
    8585
    8686    llvm::Value * getBufferedSize(const std::string & name);
    87 
     87   
    8888    void setBufferedSize(const std::string & name, llvm::Value * size);
    89 
     89   
     90    llvm::Value * getCapacity(const std::string & name);
     91   
     92    void setCapacity(const std::string & name, llvm::Value * c);
     93   
    9094    llvm::Value * getAvailableItemCount(const std::string & name);
    9195
    9296    llvm::Value * getLinearlyAccessibleItems(const std::string & name, llvm::Value * fromPosition);
    93 
     97   
     98    llvm::Value * getLinearlyAccessibleBlocks(const std::string & name, llvm::Value * fromBlock);
     99   
     100    llvm::Value * getLinearlyWritableItems(const std::string & name, llvm::Value * fromPosition);
     101   
     102    llvm::Value * getLinearlyWritableBlocks(const std::string & name, llvm::Value * fromBlock);
     103   
    94104    llvm::BasicBlock * CreateConsumerWait();
    95105
  • icGREP/icgrep-devel/icgrep/kernels/source_kernel.cpp

    r5500 r5501  
    168168    kb->setBaseAddress("sourceBuffer", buffer);
    169169    kb->setBufferedSize("sourceBuffer", kb->getSize(0));
     170    kb->setCapacity("sourceBuffer", kb->getSize(initialBufferSize));
    170171}
    171172
     
    261262    kb->setScalarField("buffer", expandedBuffer);
    262263    kb->setScalarField("capacity", expandedCapacity);
     264    kb->setCapacity("sourceBuffer", expandedCapacity);
    263265    kb->CreateBr(calculateLogicalAddress);
    264266
  • icGREP/icgrep-devel/icgrep/kernels/streamset.cpp

    r5498 r5501  
    6262void StreamSetBuffer::setBufferedSize(IDISA::IDISA_Builder * const iBuilder, Value * /* self */, llvm::Value * /* size */) const {
    6363    report_fatal_error("setBufferedSize is not supported by this buffer type");
     64}
     65
     66Value * StreamSetBuffer::getCapacity(IDISA::IDISA_Builder * const iBuilder, Value * /* self */) const {
     67    report_fatal_error("getCapacity is not supported by this buffer type");
     68}
     69
     70void StreamSetBuffer::setCapacity(IDISA::IDISA_Builder * const iBuilder, Value * /* self */, llvm::Value * /* c */) const {
     71    report_fatal_error("setCapacity is not supported by this buffer type");
    6472}
    6573
     
    115123}
    116124
    117 Value * StreamSetBuffer::getLinearlyAccessibleItems(IDISA::IDISA_Builder * const iBuilder, Value * fromPosition) const {
     125Value * StreamSetBuffer::getLinearlyAccessibleItems(IDISA::IDISA_Builder * const iBuilder, Value * self, Value * fromPosition) const {
    118126    if (isa<ArrayType>(mType) && dyn_cast<ArrayType>(mType)->getNumElements() > 1) {
    119127        Constant * stride = iBuilder->getSize(iBuilder->getStride());
     
    125133}
    126134
    127 Value * StreamSetBuffer::getLinearlyAccessibleBlocks(IDISA::IDISA_Builder * const iBuilder, Value * fromBlock) const {
     135Value * StreamSetBuffer::getLinearlyAccessibleBlocks(IDISA::IDISA_Builder * const iBuilder, Value * self, Value * fromBlock) const {
    128136    Constant * bufBlocks = iBuilder->getSize(mBufferBlocks);
    129137    return iBuilder->CreateSub(bufBlocks, iBuilder->CreateURem(fromBlock, bufBlocks), "linearBlocks");
    130138}
    131139
    132 Value * StreamSetBuffer::getLinearlyWritableItems(IDISA::IDISA_Builder * const iBuilder, Value * fromPosition) const {
    133     return getLinearlyAccessibleItems(iBuilder, fromPosition);
    134 }
    135 
    136 Value * StreamSetBuffer::getLinearlyWritableBlocks(IDISA::IDISA_Builder * const iBuilder, Value * fromBlock) const {
    137     return getLinearlyAccessibleBlocks(iBuilder, fromBlock);
     140Value * StreamSetBuffer::getLinearlyWritableItems(IDISA::IDISA_Builder * const iBuilder, Value * self, Value * fromPosition) const {
     141    return getLinearlyAccessibleItems(iBuilder, self, fromPosition);
     142}
     143
     144Value * StreamSetBuffer::getLinearlyWritableBlocks(IDISA::IDISA_Builder * const iBuilder, Value * self, Value * fromBlock) const {
     145    return getLinearlyAccessibleBlocks(iBuilder, self, fromBlock);
    138146}
    139147
     
    193201// Source File Buffer
    194202Value * SourceBuffer::getBufferedSize(IDISA::IDISA_Builder * const iBuilder, Value * self) const {
    195     Value * ptr = iBuilder->CreateGEP(self, {iBuilder->getInt32(0), iBuilder->getInt32(1)});
     203    Value * ptr = iBuilder->CreateGEP(self, {iBuilder->getInt32(0), iBuilder->getInt32(int(SourceBuffer::Field::BufferedSize))});
    196204    return iBuilder->CreateLoad(ptr);
    197205}
    198206
    199207void SourceBuffer::setBufferedSize(IDISA::IDISA_Builder * const iBuilder, Value * self, llvm::Value * size) const {
    200     Value * ptr = iBuilder->CreateGEP(self, {iBuilder->getInt32(0), iBuilder->getInt32(1)});
     208    Value * ptr = iBuilder->CreateGEP(self, {iBuilder->getInt32(0), iBuilder->getInt32(int(SourceBuffer::Field::BufferedSize))});
    201209    iBuilder->CreateStore(size, ptr);
    202210}
    203211
     212Value * SourceBuffer::getCapacity(IDISA::IDISA_Builder * const iBuilder, Value * self) const {
     213    Value * ptr = iBuilder->CreateGEP(self, {iBuilder->getInt32(0), iBuilder->getInt32(int(SourceBuffer::Field::Capacity))});
     214    return iBuilder->CreateLoad(ptr);
     215}
     216
     217void SourceBuffer::setCapacity(IDISA::IDISA_Builder * const iBuilder, Value * self, llvm::Value * c) const {
     218    Value * ptr = iBuilder->CreateGEP(self, {iBuilder->getInt32(0), iBuilder->getInt32(int(SourceBuffer::Field::Capacity))});
     219    iBuilder->CreateStore(c, ptr);
     220}
     221
    204222void SourceBuffer::setBaseAddress(IDISA::IDISA_Builder * const iBuilder, Value * self, Value * addr) const {
    205     Value * const ptr = iBuilder->CreateGEP(self, {iBuilder->getInt32(0), iBuilder->getInt32(0)});
     223    Value * const ptr = iBuilder->CreateGEP(self, {iBuilder->getInt32(0), iBuilder->getInt32(int(SourceBuffer::Field::BaseAddress))});
    206224    iBuilder->CreateStore(iBuilder->CreatePointerCast(addr, ptr->getType()->getPointerElementType()), ptr);
    207225}
     
    209227Value * SourceBuffer::getBaseAddress(IDISA::IDISA_Builder * const iBuilder, Value * const self) const {
    210228    iBuilder->CreateAssert(self, "SourceBuffer: instance cannot be null");
    211     Value * const ptr = iBuilder->CreateGEP(self, {iBuilder->getInt32(0), iBuilder->getInt32(0)});
     229    Value * const ptr = iBuilder->CreateGEP(self, {iBuilder->getInt32(0), iBuilder->getInt32(int(SourceBuffer::Field::BaseAddress))});
    212230    Value * const addr = iBuilder->CreateLoad(ptr);
    213231    iBuilder->CreateAssert(addr, "SourceBuffer: base address cannot be 0");
     
    219237}
    220238
    221 Value * SourceBuffer::getLinearlyAccessibleItems(IDISA::IDISA_Builder * const iBuilder, Value *) const {
    222     report_fatal_error("External buffers: getLinearlyAccessibleItems is not supported.");
    223 }
     239Value * SourceBuffer::getLinearlyAccessibleItems(IDISA::IDISA_Builder * const iBuilder, Value * self, Value * fromPosition) const {
     240    return iBuilder->CreateSub(getCapacity(iBuilder, self), fromPosition);
     241}
     242
    224243
    225244// External File Buffer
     
    232251}
    233252
    234 Value * ExternalBuffer::getLinearlyAccessibleItems(IDISA::IDISA_Builder * const iBuilder, Value *) const {
     253Value * ExternalBuffer::getLinearlyAccessibleItems(IDISA::IDISA_Builder * const iBuilder, Value * self, Value *) const {
    235254    report_fatal_error("External buffers: getLinearlyAccessibleItems is not supported.");
    236255}
     
    265284}
    266285
    267 Value * CircularCopybackBuffer::getLinearlyWritableItems(IDISA::IDISA_Builder * const iBuilder, Value * fromPosition) const {
    268     return iBuilder->CreateAdd(getLinearlyAccessibleItems(iBuilder, fromPosition), iBuilder->getSize(mOverflowBlocks * iBuilder->getBitBlockWidth()));
    269 }
    270 
    271 Value * CircularCopybackBuffer::getLinearlyWritableBlocks(IDISA::IDISA_Builder * const iBuilder, Value * fromBlock) const {
    272     return iBuilder->CreateAdd(getLinearlyAccessibleBlocks(iBuilder, fromBlock), iBuilder->getSize(mOverflowBlocks));
     286Value * CircularCopybackBuffer::getLinearlyWritableItems(IDISA::IDISA_Builder * const iBuilder, Value * self, Value * fromPosition) const {
     287    return iBuilder->CreateAdd(getLinearlyAccessibleItems(iBuilder, self, fromPosition), iBuilder->getSize(mOverflowBlocks * iBuilder->getBitBlockWidth()));
     288}
     289
     290Value * CircularCopybackBuffer::getLinearlyWritableBlocks(IDISA::IDISA_Builder * const iBuilder, Value * self, Value * fromBlock) const {
     291    return iBuilder->CreateAdd(getLinearlyAccessibleBlocks(iBuilder, self, fromBlock), iBuilder->getSize(mOverflowBlocks));
    273292}
    274293
     
    326345}
    327346
    328 Value * SwizzledCopybackBuffer::getLinearlyWritableItems(IDISA::IDISA_Builder * const iBuilder, Value * fromPosition) const {
    329     return iBuilder->CreateAdd(getLinearlyAccessibleItems(iBuilder, fromPosition), iBuilder->getSize(mOverflowBlocks * iBuilder->getBitBlockWidth()));
    330 }
    331 
    332 Value * SwizzledCopybackBuffer::getLinearlyWritableBlocks(IDISA::IDISA_Builder * const iBuilder, Value * fromBlock) const {
    333     return iBuilder->CreateAdd(getLinearlyAccessibleBlocks(iBuilder, fromBlock), iBuilder->getSize(mOverflowBlocks));
     347Value * SwizzledCopybackBuffer::getLinearlyWritableItems(IDISA::IDISA_Builder * const iBuilder, Value * self, Value * fromPosition) const {
     348    return iBuilder->CreateAdd(getLinearlyAccessibleItems(iBuilder, self, fromPosition), iBuilder->getSize(mOverflowBlocks * iBuilder->getBitBlockWidth()));
     349}
     350
     351Value * SwizzledCopybackBuffer::getLinearlyWritableBlocks(IDISA::IDISA_Builder * const iBuilder, Value * self, Value * fromBlock) const {
     352    return iBuilder->CreateAdd(getLinearlyAccessibleBlocks(iBuilder, self, fromBlock), iBuilder->getSize(mOverflowBlocks));
    334353}
    335354
     
    488507}
    489508
    490 Value * ExpandableBuffer::getLinearlyAccessibleItems(IDISA::IDISA_Builder * const iBuilder, Value *) const {
     509Value * ExpandableBuffer::getLinearlyAccessibleItems(IDISA::IDISA_Builder * const iBuilder, Value * self, Value *) const {
    491510    report_fatal_error("Expandable buffers: getLinearlyAccessibleItems is not supported.");
    492511}
    493512
    494513SourceBuffer::SourceBuffer(const std::unique_ptr<kernel::KernelBuilder> & b, Type * type, unsigned MemoryAddressSpace, unsigned StructAddressSpace)
    495 : StreamSetBuffer(BufferKind::SourceBuffer, type, StructType::get(resolveStreamSetType(b, type)->getPointerTo(MemoryAddressSpace), b->getSizeTy(), nullptr), 0, StructAddressSpace) {
     514: StreamSetBuffer(BufferKind::SourceBuffer, type, StructType::get(resolveStreamSetType(b, type)->getPointerTo(MemoryAddressSpace), b->getSizeTy(), b->getSizeTy(), nullptr), 0, StructAddressSpace) {
    496515    mUniqueID = "B";
    497516    if (MemoryAddressSpace != 0 || StructAddressSpace != 0) {
  • icGREP/icgrep-devel/icgrep/kernels/streamset.h

    r5479 r5501  
    7272
    7373    virtual void setBufferedSize(IDISA::IDISA_Builder * const iBuilder, llvm::Value * size, llvm::Value *) const;
    74 
     74   
    7575    virtual llvm::Value * getBufferedSize(IDISA::IDISA_Builder * const iBuilder, llvm::Value * self) const;
    76 
     76   
     77    virtual void setCapacity(IDISA::IDISA_Builder * const iBuilder, llvm::Value * size, llvm::Value *) const;
     78   
     79    virtual llvm::Value * getCapacity(IDISA::IDISA_Builder * const iBuilder, llvm::Value * self) const;
     80   
    7781    // The number of items that cam be linearly accessed from a given logical stream position.
    78     virtual llvm::Value * getLinearlyAccessibleItems(IDISA::IDISA_Builder * const iBuilder, llvm::Value * fromPosition) const;
    79    
    80     virtual llvm::Value * getLinearlyAccessibleBlocks(IDISA::IDISA_Builder * const iBuilder, llvm::Value * fromBlock) const;
     82    virtual llvm::Value * getLinearlyAccessibleItems(IDISA::IDISA_Builder * const iBuilder, llvm::Value * self, llvm::Value * fromPosition) const;
     83   
     84    virtual llvm::Value * getLinearlyAccessibleBlocks(IDISA::IDISA_Builder * const iBuilder, llvm::Value * self, llvm::Value * fromBlock) const;
    8185   
    8286    void createBlockCopy(IDISA::IDISA_Builder * const iBuilder, llvm::Value * targetBlockPtr, llvm::Value * sourceBlockPtr, llvm::Value * blocksToCopy) const;
     
    8488    virtual void createBlockAlignedCopy(IDISA::IDISA_Builder * const iBuilder, llvm::Value * targetBlockPtr, llvm::Value * sourceBlockPtr, llvm::Value * itemsToCopy) const;
    8589
    86     virtual llvm::Value * getLinearlyWritableItems(IDISA::IDISA_Builder * const iBuilder, llvm::Value * fromPosition) const;
    87    
    88     virtual llvm::Value * getLinearlyWritableBlocks(IDISA::IDISA_Builder * const iBuilder, llvm::Value * fromBlock) const;
     90    virtual llvm::Value * getLinearlyWritableItems(IDISA::IDISA_Builder * const iBuilder, llvm::Value * self, llvm::Value * fromPosition) const;
     91   
     92    virtual llvm::Value * getLinearlyWritableBlocks(IDISA::IDISA_Builder * const iBuilder, llvm::Value * self, llvm::Value * fromBlock) const;
    8993   
    9094    virtual ~StreamSetBuffer() = 0;
     
    145149    void setBufferedSize(IDISA::IDISA_Builder * const iBuilder, llvm::Value * self, llvm::Value * size) const override;
    146150
     151    void setCapacity(IDISA::IDISA_Builder * const iBuilder, llvm::Value * self, llvm::Value * c) const override;
     152
    147153    llvm::Value * getBufferedSize(IDISA::IDISA_Builder * const iBuilder, llvm::Value * self) const override;
    148 
    149     llvm::Value * getLinearlyAccessibleItems(IDISA::IDISA_Builder * const iBuilder, llvm::Value * fromPosition) const override;
    150 
    151 protected:
     154   
     155    llvm::Value * getCapacity(IDISA::IDISA_Builder * const iBuilder, llvm::Value * self) const override;
     156   
     157    llvm::Value * getLinearlyAccessibleItems(IDISA::IDISA_Builder * const iBuilder, llvm::Value * self, llvm::Value * fromPosition) const override;
     158
     159protected:
     160   
     161    enum class Field {BaseAddress, BufferedSize, Capacity};
    152162
    153163    llvm::Value * getBaseAddress(IDISA::IDISA_Builder * const iBuilder, llvm::Value * self) const override;
     
    168178    void allocateBuffer(const std::unique_ptr<kernel::KernelBuilder> & iBuilder) override;
    169179
    170     llvm::Value * getLinearlyAccessibleItems(IDISA::IDISA_Builder * const iBuilder, llvm::Value * fromPosition) const override;
     180    llvm::Value * getLinearlyAccessibleItems(IDISA::IDISA_Builder * const iBuilder, llvm::Value * self, llvm::Value * fromPosition) const override;
    171181
    172182protected:
     
    210220    void createCopyBack(IDISA::IDISA_Builder * const iBuilder, llvm::Value * self, llvm::Value * overflowItems) const;
    211221       
    212     llvm::Value * getLinearlyWritableItems(IDISA::IDISA_Builder * const iBuilder, llvm::Value * fromPosition) const override;
    213    
    214     llvm::Value * getLinearlyWritableBlocks(IDISA::IDISA_Builder * const iBuilder, llvm::Value * fromBlock) const override;
     222    llvm::Value * getLinearlyWritableItems(IDISA::IDISA_Builder * const iBuilder, llvm::Value * self, llvm::Value * fromPosition) const override;
     223   
     224    llvm::Value * getLinearlyWritableBlocks(IDISA::IDISA_Builder * const iBuilder, llvm::Value * self, llvm::Value * fromBlock) const override;
    215225   
    216226private:
     
    232242    void createCopyBack(IDISA::IDISA_Builder * const iBuilder, llvm::Value * self, llvm::Value * overflowItems) const;
    233243   
    234     llvm::Value * getLinearlyWritableItems(IDISA::IDISA_Builder * const iBuilder, llvm::Value * fromPosition) const override;
    235    
    236     llvm::Value * getLinearlyWritableBlocks(IDISA::IDISA_Builder * constiBuilder, llvm::Value * fromBlock) const override;
     244    llvm::Value * getLinearlyWritableItems(IDISA::IDISA_Builder * const iBuilder, llvm::Value * self, llvm::Value * fromPosition) const override;
     245   
     246    llvm::Value * getLinearlyWritableBlocks(IDISA::IDISA_Builder * const iBuilder, llvm::Value * self, llvm::Value * fromBlock) const override;
    237247   
    238248protected:
     
    257267    llvm::Value * getStreamPackPtr(IDISA::IDISA_Builder * const iBuilder, llvm::Value * self, llvm::Value * streamIndex, llvm::Value * blockIndex, llvm::Value * packIndex, const bool readOnly) const override;
    258268
    259     llvm::Value * getLinearlyAccessibleItems(IDISA::IDISA_Builder * const iBuilder, llvm::Value * fromPosition) const override;
     269    llvm::Value * getLinearlyAccessibleItems(IDISA::IDISA_Builder * const iBuilder, llvm::Value * self, llvm::Value * fromPosition) const override;
    260270
    261271    void allocateBuffer(const std::unique_ptr<kernel::KernelBuilder> & iBuilder) override;
Note: See TracChangeset for help on using the changeset viewer.