Ignore:
Timestamp:
May 17, 2018, 3:41:00 PM (12 months ago)
Author:
nmedfort
Message:

Major refactoring of buffer types. Static buffers replace Circular and CircularCopyback?. External buffers unify Source/External?.

File:
1 edited

Legend:

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

    r6020 r6047  
    4747        Value* inputBufferBasePtr = iBuilder->getRawInputPointer("byteStream", iBuilder->getSize(0));
    4848        Value* outputBufferBasePtr = iBuilder->getRawOutputPointer("outputStream", iBuilder->getSize(0));
    49 
    50 
    51         size_t outputBufferSize = this->getOutputStreamSetBuffer("outputStream")->getBufferBlocks() * iBuilder->getStride();
    52         Value* outputBufferSizeValue = iBuilder->getSize(outputBufferSize);
    53         Value* outputBufferSizeMask = iBuilder->getSize(outputBufferSize - 1);
     49        Value* outputBufferSizeValue = iBuilder->getCapacity("outputStream");
     50        Value* outputBufferSizeMask = iBuilder->CreateSub(outputBufferSizeValue, iBuilder->getSize(1));
    5451
    5552        Value* maskedOutputOffset = iBuilder->CreateAnd(uncompressedOutputPos, outputBufferSizeMask);
     
    8582    }
    8683
    87     size_t LZ4DepositUncompressedKernel::getInputBufferSize(const unique_ptr<KernelBuilder> &iBuilder, string bufferName) {
    88         return this->getInputStreamSetBuffer(bufferName)->getBufferBlocks() * iBuilder->getStride();
    89     }
    90 
    91     Value* LZ4DepositUncompressedKernel::generateLoadCircularInput(const unique_ptr<KernelBuilder> &iBuilder, string inputBufferName, Value* offset, Type* pointerType) {
    92         size_t inputSize = this->getInputBufferSize(iBuilder, inputBufferName);
    93         Value* offsetMask = iBuilder->getSize(inputSize - 1);
     84    Value* LZ4DepositUncompressedKernel::generateLoadCircularInput(const unique_ptr<KernelBuilder> &iBuilder, const string & bufferName, Value* offset, Type* pointerType) {
     85        Value* offsetMask =  iBuilder->CreateSub(iBuilder->getCapacity(bufferName), iBuilder->getSize(1));
    9486        Value* maskedOffset = iBuilder->CreateAnd(offsetMask, offset);
    95 
    96         Value* inputBufferPtr = iBuilder->getRawInputPointer(inputBufferName, iBuilder->getSize(0));
    97 
     87        Value* inputBufferPtr = iBuilder->getRawInputPointer(bufferName, iBuilder->getSize(0));
    9888        inputBufferPtr = iBuilder->CreatePointerCast(inputBufferPtr, pointerType);
    9989        return iBuilder->CreateLoad(iBuilder->CreateGEP(inputBufferPtr, maskedOffset));
Note: See TracChangeset for help on using the changeset viewer.