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

Last change on this file since 5957 was 5957, checked in by nmedfort, 2 months ago

fixes for minor compilation issues

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