source: icGREP/icgrep-devel/icgrep/lz4/LZ4GrepGenerator.h @ 6020

Last change on this file since 6020 was 6020, checked in by xwa163, 12 months ago
  1. New version of lz4_swizzled_match_copy kernel with higher performance
  2. Adjust related pipeline code
  3. Remove legacy comments
File size: 1.5 KB
Line 
1
2#ifndef ICGREP_LZ4GREPGENERATOR_H
3#define ICGREP_LZ4GREPGENERATOR_H
4
5#include "LZ4Generator.h"
6#include <grep_interface.h>
7#include <kernels/streamset.h>
8#include <cc/multiplex_CCs.h>
9#include <string>
10#include <vector>
11#include <sstream>
12#include <atomic>
13#include <grep/grep_engine.h>
14
15typedef void (*ScanMatchGrepMainFunctionType)(char * byte_data, size_t headerSize, size_t filesize, bool hasBlockChecksum, intptr_t match_accumulator);
16
17class LZ4GrepGenerator : public LZ4Generator{
18public:
19    LZ4GrepGenerator();
20    void generateCountOnlyGrepPipeline(re::RE* regex);
21    void generateScanMatchGrepPipeline(re::RE* regex);
22    std::pair<parabix::StreamSetBuffer *, parabix::StreamSetBuffer *> grepPipeline(std::vector<re::RE *> &REs,
23                                                                                   parabix::StreamSetBuffer *ByteStream);
24
25    void invokeScanMatchGrep(char* fileBuffer, size_t blockStart, size_t blockEnd, bool hasBlockChecksum);
26
27private:
28    grep::GrepRecordBreakKind mGrepRecordBreak;
29    void initREs(std::vector<re::RE *> & REs);
30
31
32    re::CC * mBreakCC;
33    std::vector<re:: RE *> mREs;
34    std::set<re::Name *> mUnicodeProperties;
35    bool mMoveMatchesToEOL;
36
37
38    std::vector<std::ostringstream> mResultStrs;
39
40
41    void generateScanMatchMainFunc(const std::unique_ptr<kernel::KernelBuilder> & iBuilder);
42
43
44    llvm::Value * match_accumulator;
45
46    ScanMatchGrepMainFunctionType getScanMatchGrepMainFunction();
47
48    std::unique_ptr<cc::MultiplexedAlphabet> mpx;
49};
50
51
52#endif //ICGREP_LZ4GREPGENERATOR_H
Note: See TracBrowser for help on using the repository browser.