source: icGREP/icgrep-devel/icgrep/lzparabix/LZParabixGrepGenerator.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.6 KB
Line 
1//
2// Created by wxy325 on 2018/6/19.
3//
4
5#ifndef ICGREP_LZPARABIXGREPGENERATOR_H
6#define ICGREP_LZPARABIXGREPGENERATOR_H
7
8#include "LZParabixGenerator.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);
19typedef uint64_t (*CountOnlyGrepMainFunctionType)(char * byte_data, size_t headerSize, size_t filesize, bool hasBlockChecksum);
20
21class LZParabixGrepGenerator: public LZParabixGenerator {
22
23public:
24    LZParabixGrepGenerator(bool enableMultiplexing = false);
25    void generateCountOnlyAioPipeline(re::RE* regex);
26    CountOnlyGrepMainFunctionType getCountOnlyGrepMainFunction();
27protected:
28    bool mEnableMultiplexing;
29    grep::GrepRecordBreakKind mGrepRecordBreak;
30    re::CC * mBreakCC;
31    std::vector<re:: RE *> mREs;
32    std::set<re::Name *> mUnicodeProperties;
33    bool mMoveMatchesToEOL;
34    std::unique_ptr<cc::MultiplexedAlphabet> mpx;
35
36    void initREs(std::vector<re::RE *> & REs);
37
38    std::pair<parabix::StreamSetBuffer *, parabix::StreamSetBuffer *> grepPipeline(std::vector<re::RE *> &REs);
39    std::pair<parabix::StreamSetBuffer *, parabix::StreamSetBuffer *> multiplexingGrepPipeline(std::vector<re::RE *> &REs);
40
41    parabix::StreamSetBuffer * linefeedStreamFromDecompressedBits(parabix::StreamSetBuffer *decompressedBasisBits);
42
43    void generateCountOnlyMainFunc(const std::unique_ptr<kernel::KernelBuilder> & iBuilder);
44};
45
46
47#endif //ICGREP_LZPARABIXGREPGENERATOR_H
Note: See TracBrowser for help on using the repository browser.