source: icGREP/icgrep-devel/icgrep/lzparabix/LZParabixCompressorGenerator.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.3 KB
Line 
1
2#ifndef ICGREP_LZPARABIXCOMPRESSORGENERATOR_H
3#define ICGREP_LZPARABIXCOMPRESSORGENERATOR_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 (*CompressorMainFunctionType)(char * byte_data, size_t filesize);
18
19
20class LZParabixCompressorGenerator {
21public:
22    LZParabixCompressorGenerator();
23
24    CompressorMainFunctionType getMainFunc();
25
26    void generatePipeline(const std::string &outputFile);
27
28protected:
29    //// Protected Method
30    void generateMainFunc(const std::unique_ptr<kernel::KernelBuilder> & iBuilder);
31    virtual void generateLoadByteStreamAndBitStream(const std::unique_ptr<kernel::KernelBuilder> & iBuilder);
32
33    // BufferSize related Helper Function
34    virtual size_t getInputBufferBlocks(const std::unique_ptr<kernel::KernelBuilder> & iBuilder);
35
36
37    //// Data Member
38    // Driver
39    ParabixDriver mPxDriver;
40    size_t mLzParabixBlockSize;
41
42    // Runtime Arguments
43    llvm::Value * mInputStream;
44    llvm::Value * mFileSize;
45
46    // StreamSetBuffers
47    parabix::StreamSetBuffer * mCompressedByteStream;
48    parabix::StreamSetBuffer * mCompressedBasisBits;
49};
50
51
52#endif //ICGREP_LZPARABIXCOMPRESSORGENERATOR_H
Note: See TracBrowser for help on using the repository browser.