Ignore:
Timestamp:
Jun 27, 2018, 3:48:18 AM (11 months ago)
Author:
xwa163
Message:

Implement bitstream decompression version of LZ4 Aio Kernel

File:
1 edited

Legend:

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

    r6111 r6118  
    2626#include <kernels/lz4/aio/lz4_parallel_bytestream_aio.h>
    2727#include <kernels/lz4/aio/lz4_swizzled_aio.h>
     28#include <kernels/lz4/aio/lz4_bitstream_aio.h>
    2829#include <kernels/bitstream_pdep_kernel.h>
    2930#include <kernels/lz4/lz4_bitstream_not_kernel.h>
     
    405406}
    406407
     408StreamSetBuffer * LZ4Generator::generateBitStreamAIODecompression(const std::unique_ptr<kernel::KernelBuilder> & iBuilder) {
     409//// Decode Block Information
     410    StreamSetBuffer * const BlockData_IsCompressed = mPxDriver.addBuffer<StaticBuffer>(iBuilder, iBuilder->getStreamSetTy(1, 8), this->getInputBufferBlocks(iBuilder), 1);
     411    StreamSetBuffer * const BlockData_BlockStart = mPxDriver.addBuffer<StaticBuffer>(iBuilder, iBuilder->getStreamSetTy(1, 64), this->getInputBufferBlocks(iBuilder), 1);
     412    StreamSetBuffer * const BlockData_BlockEnd = mPxDriver.addBuffer<StaticBuffer>(iBuilder, iBuilder->getStreamSetTy(1, 64), this->getInputBufferBlocks(iBuilder), 1);
     413
     414    //// Generate Helper Markers Extenders, FX, XF
     415//    StreamSetBuffer * const Extenders = mPxDriver.addBuffer<StaticBuffer>(iBuilder, iBuilder->getStreamSetTy(1, 1), this->getInputBufferBlocks(iBuilder), 1);
     416//    mMatchOffsetMarker = mPxDriver.addBuffer<StaticBuffer>(iBuilder, iBuilder->getStreamSetTy(1, 1), this->getInputBufferBlocks(iBuilder));
     417//    Kernel * extenderK = mPxDriver.addKernelInstance<ParabixCharacterClassKernelBuilder>(iBuilder, "extenders", std::vector<re::CC *>{re::makeCC(0xFF)}, 8);
     418//    mPxDriver.makeKernelCall(extenderK, {mCompressedBasisBits}, {Extenders});
     419
     420
     421    Kernel * blockDecoderK = mPxDriver.addKernelInstance<LZ4BlockDecoderKernel>(iBuilder);
     422    blockDecoderK->setInitialArguments({iBuilder->CreateTrunc(mHasBlockChecksum, iBuilder->getInt1Ty()), mHeaderSize, mFileSize});
     423    mPxDriver.makeKernelCall(blockDecoderK, {mCompressedByteStream}, {BlockData_IsCompressed, BlockData_BlockStart, BlockData_BlockEnd});
     424
     425    StreamSetBuffer* decompressedBitStream = mPxDriver.addBuffer<StaticBuffer>(iBuilder, iBuilder->getStreamSetTy(8, 1), this->getDecompressedBufferBlocks(iBuilder));
     426
     427    Kernel* lz4BitStreamAioK = mPxDriver.addKernelInstance<LZ4BitStreamAioKernel>(iBuilder);
     428    lz4BitStreamAioK->setInitialArguments({mFileSize});
     429    mPxDriver.makeKernelCall(
     430            lz4BitStreamAioK,
     431            {
     432                    mCompressedByteStream,
     433
     434//                    Extenders,
     435
     436                    // Block Data
     437                    BlockData_IsCompressed,
     438                    BlockData_BlockStart,
     439                    BlockData_BlockEnd,
     440
     441                    mCompressedBasisBits
     442            }, {
     443                    decompressedBitStream
     444            });
     445    return decompressedBitStream;
     446
     447}
     448
    407449StreamSetBuffer * LZ4Generator::generateSwizzledAIODecompression(const std::unique_ptr<kernel::KernelBuilder> & iBuilder) {
    408450    //// Decode Block Information
Note: See TracChangeset for help on using the changeset viewer.