source: icGREP/icgrep-devel/icgrep/lz4/lz4_base_generator.h @ 6173

Last change on this file since 6173 was 6150, checked in by xwa163, 13 months ago
  1. Remove LZParabix related codes
  2. Enable multiplexing for LZ4 ScanMatch? pipeline
  3. Some minor bug fixing
File size: 2.2 KB
Line 
1
2
3#ifndef ICGREP_LZ4BASEGENERATOR_H
4#define ICGREP_LZ4BASEGENERATOR_H
5
6#include <llvm/IR/Module.h>
7#include <llvm/IR/Function.h>
8
9#include <llvm/Support/Signals.h>
10#include <llvm/Support/ManagedStatic.h>
11#include <IR_Gen/idisa_target.h>
12
13#include <toolchain/toolchain.h>
14
15#include <toolchain/cpudriver.h>
16#include <string>
17
18struct LZ4BlockInfo {
19    parabix::StreamSetBuffer* blockStart;
20    parabix::StreamSetBuffer* blockEnd;
21    parabix::StreamSetBuffer* isCompress;
22};
23
24class LZ4BaseGenerator {
25public:
26    LZ4BaseGenerator();
27    virtual ~LZ4BaseGenerator(){};
28protected:
29    //// Member Function
30    // Input
31    parabix::StreamSetBuffer* loadByteStream();
32    std::pair<parabix::StreamSetBuffer*, parabix::StreamSetBuffer*> loadByteStreamAndBitStream();
33
34    // Stream Conversion
35    parabix::StreamSetBuffer* s2p(parabix::StreamSetBuffer* byteStream);
36    parabix::StreamSetBuffer* p2s(parabix::StreamSetBuffer* bitStream);
37
38
39            // LZ4 Decoder
40    LZ4BlockInfo getBlockInfo(parabix::StreamSetBuffer* compressedByteStream);
41    parabix::StreamSetBuffer * byteStreamDecompression(
42            parabix::StreamSetBuffer* compressedByteStream
43    );
44    parabix::StreamSetBuffer * swizzledDecompression(
45            parabix::StreamSetBuffer* compressedByteStream,
46            parabix::StreamSetBuffer* compressedBasisBits
47    );
48    parabix::StreamSetBuffer * bitStreamDecompression(
49            parabix::StreamSetBuffer* compressedByteStream,
50            parabix::StreamSetBuffer* compressedBasisBits
51    );
52
53    std::vector<parabix::StreamSetBuffer*> convertCompressedBitsStreamWithBitStreamAioApproach(
54            parabix::StreamSetBuffer* compressedByteStream,
55            std::vector<parabix::StreamSetBuffer*> compressedBitStreams
56    );
57
58
59
60    // BufferSize related Helper Function
61    unsigned getDefaultBufferBlocks();
62    unsigned getBlockSizeBufferBlocks();
63
64
65    //// Data Member
66    // Driver
67    ParabixDriver mPxDriver;
68
69    // Runtime Arguments
70    llvm::Value * mInputStream;
71    llvm::Value * mHeaderSize;
72    llvm::Value * mFileSize;
73    llvm::Value * mHasBlockChecksum;
74
75    unsigned mLz4BlockSize;
76
77    bool mInitBlockInfo;
78    LZ4BlockInfo mBlockInfo;
79};
80
81
82#endif //ICGREP_LZ4BASEGENERATOR_H
Note: See TracBrowser for help on using the repository browser.