source: icGREP/icgrep-devel/icgrep/kernels/lzparabix/decoder/LZParabixAioKernel.h @ 6132

Last change on this file since 6132 was 6132, checked in by xwa163, 12 months ago
  1. More experiment on lz4 grep
  2. Improve performance of lzparabix grep
File size: 1.9 KB
Line 
1//
2// Created by wxy325 on 2018/6/18.
3//
4
5#ifndef ICGREP_LZPARABIXAIOKERNEL_H
6#define ICGREP_LZPARABIXAIOKERNEL_H
7
8#include "kernels/kernel.h"
9#include <string>
10#include <map>
11#include <vector>
12
13namespace llvm {
14    class Module;
15    class Function;
16    class BasicBlock;
17    class Value;
18}
19
20namespace IDISA { class IDISA_Builder; }
21
22namespace kernel {
23
24    class LZParabixAioKernel : public SegmentOrientedKernel {
25
26    public:
27        LZParabixAioKernel(const std::unique_ptr<kernel::KernelBuilder> &b, std::vector<unsigned> numsOfBitStreams = {8});
28
29    protected:
30        void generateProcessCompressedBlock(const std::unique_ptr<KernelBuilder> &b, llvm::Value *lz4BlockStart,
31                                            llvm::Value *lz4BlockEnd);
32        void generateDoSegmentMethod(const std::unique_ptr<KernelBuilder> &b) override;
33        llvm::Value *generateLoadInt64NumberInput(const std::unique_ptr<KernelBuilder> &iBuilder,
34                                                  std::string inputBufferName, llvm::Value *globalOffset);
35        std::pair<llvm::Value*, llvm::Value*> processSequence(const std::unique_ptr<KernelBuilder> &b, llvm::Value* beginLiteralPos, llvm::Value *beginTokenPos,
36                                                         llvm::Value *lz4BlockEnd);
37        void processLiteral(const std::unique_ptr<KernelBuilder> &b, llvm::Value* cursorPos, llvm::Value* literalLength);
38        llvm::Value *processMatch(const std::unique_ptr<KernelBuilder> &b, llvm::Value* cursorPos, llvm::Value* matchOffset, llvm::Value* sequenceBasePtr);
39
40
41        std::vector<unsigned> mNumsOfBitStreams;
42
43        // ---- Output
44        void initPendingOutputScalar(const std::unique_ptr<KernelBuilder> &b);
45        void appendBitStreamOutput(const std::unique_ptr<KernelBuilder> &b, std::vector<llvm::Value*>& extractedValues, llvm::Value* valueLength);
46
47        void initScalarOutputPtr(const std::unique_ptr<KernelBuilder> &b);
48    };
49
50}
51
52
53
54
55#endif //ICGREP_LZPARABIXAIOKERNEL_H
Note: See TracBrowser for help on using the repository browser.