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

Last change on this file since 6040 was 6040, checked in by xwa163, 16 months ago

Init checkin for bitstream_pdep_kernel with gather intrinsics

File size: 2.1 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(bool enableMultiplexing = false);
20    void generateSwizzledCountOnlyGrepPipeline(re::RE *regex);
21    void generateCountOnlyGrepPipeline(re::RE *regex, bool enableGather = true);
22
23    void generateScanMatchGrepPipeline(re::RE* regex);
24    std::pair<parabix::StreamSetBuffer *, parabix::StreamSetBuffer *> grepPipeline(std::vector<re::RE *> &REs,
25                                                                                   parabix::StreamSetBuffer *decompressedBasisBits);
26    std::pair<parabix::StreamSetBuffer *, parabix::StreamSetBuffer *> multiplexingGrepPipeline(std::vector<re::RE *> &REs,
27                                                                                   parabix::StreamSetBuffer *matchCopiedBasisBits);
28
29
30    void invokeScanMatchGrep(char* fileBuffer, size_t blockStart, size_t blockEnd, bool hasBlockChecksum);
31
32private:
33    bool mEnableMultiplexing;
34
35    grep::GrepRecordBreakKind mGrepRecordBreak;
36    void initREs(std::vector<re::RE *> & REs);
37
38
39    re::CC * mBreakCC;
40    std::vector<re:: RE *> mREs;
41    std::set<re::Name *> mUnicodeProperties;
42    bool mMoveMatchesToEOL;
43
44
45    std::vector<std::ostringstream> mResultStrs;
46
47
48    void generateScanMatchMainFunc(const std::unique_ptr<kernel::KernelBuilder> & iBuilder);
49
50
51    llvm::Value * match_accumulator;
52
53    ScanMatchGrepMainFunctionType getScanMatchGrepMainFunction();
54
55    std::unique_ptr<cc::MultiplexedAlphabet> mpx;
56
57    parabix::StreamSetBuffer * linefeedStreamFromDecompressedBits(parabix::StreamSetBuffer *decompressedBasisBits);
58    parabix::StreamSetBuffer * linefeedStreamFromCompressedBits();
59};
60
61
62#endif //ICGREP_LZ4GREPGENERATOR_H
Note: See TracBrowser for help on using the repository browser.