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

Last change on this file since 6143 was 6143, checked in by xwa163, 10 months ago

lz4_grep: some bug fixing and refactor

File size: 2.1 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
37
38            // LZ4 Decoder
39    LZ4BlockInfo getBlockInfo(parabix::StreamSetBuffer* compressedByteStream);
40    parabix::StreamSetBuffer * byteStreamDecompression(
41            parabix::StreamSetBuffer* compressedByteStream
42    );
43    parabix::StreamSetBuffer * swizzledDecompression(
44            parabix::StreamSetBuffer* compressedByteStream,
45            parabix::StreamSetBuffer* compressedBasisBits
46    );
47    parabix::StreamSetBuffer * bitStreamDecompression(
48            parabix::StreamSetBuffer* compressedByteStream,
49            parabix::StreamSetBuffer* compressedBasisBits
50    );
51
52    std::vector<parabix::StreamSetBuffer*> convertCompressedBitsStreamWithBitStreamAioApproach(
53            parabix::StreamSetBuffer* compressedByteStream,
54            std::vector<parabix::StreamSetBuffer*> compressedBitStreams
55    );
56
57
58
59    // BufferSize related Helper Function
60    unsigned getDefaultBufferBlocks();
61    unsigned getBlockSizeBufferBlocks();
62
63
64    //// Data Member
65    // Driver
66    ParabixDriver mPxDriver;
67
68    // Runtime Arguments
69    llvm::Value * mInputStream;
70    llvm::Value * mHeaderSize;
71    llvm::Value * mFileSize;
72    llvm::Value * mHasBlockChecksum;
73
74    unsigned mLz4BlockSize;
75};
76
77
78#endif //ICGREP_LZ4BASEGENERATOR_H
Note: See TracBrowser for help on using the repository browser.