source: icGREP/icgrep-devel/icgrep/lz4/LZ4Generator.h @ 6136

Last change on this file since 6136 was 6136, checked in by xwa163, 12 months ago
  1. Cleanup legacy slow LZ4 related kernels
  2. Rename lz4d_ext_dep to lz4_decompression
  3. Rename LZ4 AIO related kernels to LZ4 Decompression Kernel
File size: 2.6 KB
RevLine 
[5864]1
2#ifndef ICGREP_LZ4GENERATOR_H
3#define ICGREP_LZ4GENERATOR_H
4#include <llvm/IR/Module.h>
5#include <llvm/IR/Function.h>
6
7#include <llvm/Support/Signals.h>
8#include <llvm/Support/ManagedStatic.h>
9#include <IR_Gen/idisa_target.h>
10
11#include <toolchain/toolchain.h>
12
13#include <toolchain/cpudriver.h>
14#include <string>
15
16namespace re { class CC; }
17
18
19typedef void (*MainFunctionType)(char * byte_data, size_t headerSize, size_t filesize, bool hasBlockChecksum);
20
[6132]21struct LZ4BlockInfo {
22    parabix::StreamSetBuffer* blockStart;
23    parabix::StreamSetBuffer* blockEnd;
24    parabix::StreamSetBuffer* isCompress;
25};
26
[5864]27class LZ4Generator {
28
29public:
30    LZ4Generator();
31    MainFunctionType getMainFunc();
32
[6136]33    void generateDecompressionPipeline(const std::string &outputFile);
34protected:
[5864]35
[5921]36    //// Protected Method
[6119]37    std::vector<parabix::StreamSetBuffer*> convertCompressedBitsStreamWithBitStreamAioApproach(
38            std::vector<parabix::StreamSetBuffer*> compressedBitStreams, std::string prefix);
39
[5957]40    void generateMainFunc(const std::unique_ptr<kernel::KernelBuilder> & iBuilder);
[5864]41    // Pipeline
[6064]42    virtual void generateLoadByteStream(const std::unique_ptr<kernel::KernelBuilder> & iBuilder);
[5921]43    virtual void generateLoadByteStreamAndBitStream(const std::unique_ptr<kernel::KernelBuilder> & iBuilder);
[6111]44    virtual parabix::StreamSetBuffer * generateParallelAIODecompression(const std::unique_ptr<kernel::KernelBuilder> & iBuilder, bool enableGather, bool enableScatter, int minParallelLevel);
[6059]45    virtual parabix::StreamSetBuffer * generateAIODecompression(const std::unique_ptr<kernel::KernelBuilder> & iBuilder);
46    virtual parabix::StreamSetBuffer * generateSwizzledAIODecompression(const std::unique_ptr<kernel::KernelBuilder> & iBuilder);
[6118]47    virtual parabix::StreamSetBuffer * generateBitStreamAIODecompression(const std::unique_ptr<kernel::KernelBuilder> & iBuilder);
48
[5864]49    // BufferSize related Helper Function
[6066]50    virtual int getInputBufferBlocks(const std::unique_ptr<kernel::KernelBuilder> & iBuilder);
51    virtual int getDecompressedBufferBlocks(const std::unique_ptr<kernel::KernelBuilder> & iBuilder);
[5948]52    int get4MbBufferBlocks();
[5864]53
[5921]54
[5864]55    //// Data Member
56    // Driver
[6026]57    ParabixDriver mPxDriver;
[5864]58
59    // Runtime Arguments
[6026]60    llvm::Value * mInputStream;
61    llvm::Value * mHeaderSize;
62    llvm::Value * mFileSize;
63    llvm::Value * mHasBlockChecksum;
[5864]64
65    // StreamSetBuffers
[6026]66    parabix::StreamSetBuffer * mCompressedByteStream;
67    parabix::StreamSetBuffer * mCompressedBasisBits;
[5864]68
[6111]69    unsigned mLz4BlockSize;
[6132]70
71    LZ4BlockInfo getBlockInfo(const std::unique_ptr<kernel::KernelBuilder> & b);
[5864]72};
73
74
75#endif //ICGREP_LZ4GENERATOR_H
Note: See TracBrowser for help on using the repository browser.