source: icGREP/icgrep-devel/icgrep/lzparabix/LZParabixGenerator.h @ 6114

Last change on this file since 6114 was 6114, checked in by xwa163, 13 months ago

Init check in for new compression format (lzparabix) related kernels and pipelines, including compressor, decoder and grep

File size: 1.7 KB
Line 
1
2#ifndef ICGREP_LZPARABIXGENERATOR_H
3#define ICGREP_LZPARABIXGENERATOR_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#include <vector>
16
17typedef void (*MainFunctionType)(char * byte_data, size_t headerSize, size_t filesize, bool hasBlockChecksum);
18
19class LZParabixGenerator {
20public:
21    LZParabixGenerator();
22
23    MainFunctionType getMainFunc();
24
25    void generatePipeline(const std::string &outputFile);
26
27protected:
28    //// Protected Method
29    void generateMainFunc(const std::unique_ptr<kernel::KernelBuilder> & iBuilder);
30    virtual void generateLoadByteStreamAndBitStream(const std::unique_ptr<kernel::KernelBuilder> & iBuilder);
31
32    std::vector<parabix::StreamSetBuffer*> generateAioBitStreamDecompressoin(
33            const std::unique_ptr<kernel::KernelBuilder> & iBuilder,
34            std::vector<parabix::StreamSetBuffer*> bitStreamSets
35    );
36
37
38    // BufferSize related Helper Function
39    virtual int getInputBufferBlocks(const std::unique_ptr<kernel::KernelBuilder> & iBuilder);
40    virtual int getDecompressedBufferBlocks(const std::unique_ptr<kernel::KernelBuilder> & iBuilder);
41    int get4MbBufferBlocks();
42
43    //// Data Member
44    // Driver
45    ParabixDriver mPxDriver;
46    size_t mLzParabixBlockSize;
47
48
49    // Runtime Arguments
50    llvm::Value * mInputStream;
51    llvm::Value * mHeaderSize;
52    llvm::Value * mFileSize;
53    llvm::Value * mHasBlockChecksum;
54
55
56    // StreamSetBuffers
57    parabix::StreamSetBuffer * mCompressedByteStream;
58    parabix::StreamSetBuffer * mCompressedBasisBits;
59};
60
61
62#endif //ICGREP_LZPARABIXGENERATOR_H
Note: See TracBrowser for help on using the repository browser.