Ignore:
Timestamp:
Apr 1, 2017, 1:14:57 PM (2 years ago)
Author:
nmedfort
Message:

Investigating jenkins issue.

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

Legend:

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

    r5379 r5389  
    322322    Value * itemCount = getProducedItemCount(instance, name);
    323323    const StreamSetBuffer * const buf = getOutputStreamSetBuffer(name);
    324     buf->reserveBytes(getStreamSetBufferPtr(name), itemCount, value);
     324    buf->reserveBytes(getStreamSetBufferPtr(name), iBuilder->CreateAdd(itemCount, value));
    325325}
    326326
  • icGREP/icgrep-devel/icgrep/kernels/scanmatchgen.cpp

    r5379 r5389  
    3737    return iBuilder->CreateAnd(bits_minus1, bits);
    3838}
    39        
    40 
    4139
    4240void ScanMatchKernel::generateDoBlockMethod() {
  • icGREP/icgrep-devel/icgrep/kernels/streamset.cpp

    r5386 r5389  
    115115}
    116116
    117 void StreamSetBuffer::reserveBytes(Value * self, llvm::Value * position, llvm::Value *requested) const {
     117void StreamSetBuffer::reserveBytes(Value * self, llvm::Value *requested) const {
    118118    report_fatal_error("reserve() can only be used with ExtensibleBuffers");
    119119}
     
    177177}
    178178
    179 void ExtensibleBuffer::reserveBytes(Value * const self, llvm::Value * const position, llvm::Value * const requested) const {
     179void ExtensibleBuffer::reserveBytes(Value * const self, llvm::Value * const requiredSize) const {
    180180    Value * const capacityPtr = iBuilder->CreateGEP(self, {iBuilder->getInt32(0), iBuilder->getInt32(0)});
    181181    Value * const currentSize = iBuilder->CreateLoad(capacityPtr);
    182     Type * const intTy = currentSize->getType();
    183     assert (position->getType() == requested->getType());
    184     Constant * const blockSize = ConstantExpr::getIntegerCast(ConstantExpr::getIntegerCast(ConstantExpr::getSizeOf(getType()->getStructElementType(1)), intTy, false), requested->getType(), false);
    185182    BasicBlock * const entry = iBuilder->GetInsertBlock();
    186183    BasicBlock * const expand = BasicBlock::Create(iBuilder->getContext(), "expand", entry->getParent());
    187184    BasicBlock * const resume = BasicBlock::Create(iBuilder->getContext(), "resume", entry->getParent());
    188     Value * const reserved = iBuilder->CreateAdd(iBuilder->CreateMul(position, blockSize), requested);
    189     iBuilder->CreateLikelyCondBr(iBuilder->CreateICmpULT(reserved, currentSize), resume, expand);
     185    iBuilder->CreateLikelyCondBr(iBuilder->CreateICmpULT(requiredSize, currentSize), resume, expand);
    190186    iBuilder->SetInsertPoint(expand);
    191     Value * const reservedSize = iBuilder->CreateShl(reserved, 1);
     187    Value * const reservedSize = iBuilder->CreateShl(requiredSize, 1);
    192188    Value * const baseAddrPtr = iBuilder->CreateGEP(self, {iBuilder->getInt32(0), iBuilder->getInt32(1)});
    193189    Value * const baseAddr = iBuilder->CreateLoad(baseAddrPtr);
     
    197193    iBuilder->CreateStore(newAddr, baseAddrPtr);
    198194    iBuilder->CreateBr(resume);
    199 
    200195    iBuilder->SetInsertPoint(resume);
    201196}
  • icGREP/icgrep-devel/icgrep/kernels/streamset.h

    r5386 r5389  
    6161    virtual llvm::Value * getLinearlyAccessibleBlocks(llvm::Value * self, llvm::Value * fromBlock) const;
    6262
    63     virtual void reserveBytes(llvm::Value * self, llvm::Value * position, llvm::Value * requested) const;
     63    virtual void reserveBytes(llvm::Value * self, llvm::Value * requested) const;
    6464
    6565    virtual ~StreamSetBuffer() = 0;
     
    131131    void allocateBuffer() override;
    132132
    133     void reserveBytes(llvm::Value * self, llvm::Value * position, llvm::Value * requested) const override;
     133    void reserveBytes(llvm::Value * self, llvm::Value * required) const override;
    134134
    135135    void releaseBuffer(llvm::Value * self) override;
Note: See TracChangeset for help on using the changeset viewer.