source: icGREP/icgrep-devel/icgrep/kernels/lzparabix/decoder/LZParabixAioBaseKernel.h @ 6133

Last change on this file since 6133 was 6133, checked in by xwa163, 13 months ago
  1. Add sourceCC in multiplexed CC
  2. Remove workaround FakeBasisBits? from ICGrep
  3. Implement Swizzled version of LZParabix
  4. Init checkin for SwizzleByGather? Kernel
File size: 2.2 KB
RevLine 
[6133]1#ifndef ICGREP_LZPARABIXAIOKERNEL_H
2#define ICGREP_LZPARABIXAIOKERNEL_H
3
4#include "kernels/kernel.h"
5#include <string>
6#include <map>
7#include <vector>
8
9namespace llvm {
10    class Module;
11    class Function;
12    class BasicBlock;
13    class Value;
14}
15
16namespace IDISA { class IDISA_Builder; }
17
18namespace kernel {
19
20    class LZParabixAioBaseKernel : public SegmentOrientedKernel {
21    public:
22        LZParabixAioBaseKernel(const std::unique_ptr<kernel::KernelBuilder> &b, std::string&& name = "LZParabixAioKernel");
23
24    protected:
25        void generateDoSegmentMethod(const std::unique_ptr<KernelBuilder> &b) override;
26
27        virtual void doLiteralCopy(const std::unique_ptr<KernelBuilder> &b, llvm::Value *cursorPos, llvm::Value *literalLength) = 0;
28        virtual void doMatchCopy(const std::unique_ptr<KernelBuilder> &b, llvm::Value* cursorPos, llvm::Value* matchOffset, llvm::Value* matchMask) = 0;
29        virtual void initDoSegmentMethod(const std::unique_ptr<KernelBuilder> &b) {};
30        virtual llvm::Value* isAllItemAvailable(const std::unique_ptr<KernelBuilder> &b, llvm::Value* literalLength);
31        virtual void setProducedOutputItemCount(const std::unique_ptr<KernelBuilder> &b, llvm::Value* c) = 0;
32        virtual llvm::Value* getProcessedInputItemCount(const std::unique_ptr<KernelBuilder> &b) = 0;
33        virtual void setProcessedInputItemCount(const std::unique_ptr<KernelBuilder> &b, llvm::Value* c) = 0;
34
35    private:
36        void generateProcessCompressedBlock(const std::unique_ptr<KernelBuilder> &b, llvm::Value *lz4BlockStart,
37                                            llvm::Value *lz4BlockEnd);
38        llvm::Value *generateLoadInt64NumberInput(const std::unique_ptr<KernelBuilder> &iBuilder,
39                                                  std::string inputBufferName, llvm::Value *globalOffset);
40        std::pair<llvm::Value*, llvm::Value*> processSequence(const std::unique_ptr<KernelBuilder> &b, llvm::Value* beginLiteralPos, llvm::Value *beginTokenPos,
41                                                              llvm::Value *lz4BlockEnd);
42        llvm::Value *processMatch(const std::unique_ptr<KernelBuilder> &b, llvm::Value* cursorPos, llvm::Value* matchOffset, llvm::Value* sequenceBasePtr);
43    };
44}
45
46
47
48
49#endif //ICGREP_LZPARABIXAIOKERNEL_H
Note: See TracBrowser for help on using the repository browser.