source: icGREP/icgrep-devel/icgrep/kernels/lz4/lz4_block_decoder.h @ 5864

Last change on this file since 5864 was 5864, checked in by xwa163, 15 months ago

Add LZ4D extract deposit related kernel, target and test cases

File size: 1.4 KB
Line 
1//
2// Created by wxy325 on 2017/6/25.
3//
4
5#ifndef ICGREP_LZ4D_E_D_H
6#define ICGREP_LZ4D_E_D_H
7
8#include "kernels/kernel.h"
9
10namespace llvm {
11    class Module;
12    class Function;
13    class BasicBlock;
14    class Value;
15}
16
17namespace IDISA { class IDISA_Builder; }
18
19namespace kernel {
20
21class LZ4BlockDecoderKernel final : public MultiBlockKernel {
22
23public:
24    LZ4BlockDecoderKernel(const std::unique_ptr<kernel::KernelBuilder> &iBuilder);
25
26protected:
27    void generateMultiBlockLogic(const std::unique_ptr<KernelBuilder> &iBuilder, llvm::Value * const numOfStrides) override;
28//    virtual void generateDoBlockMethod(const std::unique_ptr<KernelBuilder> & iBuilder) override;
29//    void generateDoSegmentMethod(const std::unique_ptr<KernelBuilder> &iBuilder) override;
30
31private:
32    const size_t wordWidth;
33
34    llvm::Value *generateLoadInput(const std::unique_ptr<KernelBuilder> &iBuilder, llvm::Value *offset);
35
36    llvm::Value *appendOutput(const std::unique_ptr<KernelBuilder> & iBuilder, llvm::Value *isCompressed, llvm::Value *blockStart, llvm::Value *blockEnd);
37
38    void generateStoreCircularOutput(const std::unique_ptr<KernelBuilder> &iBuilder, const std::string& outputBufferName,
39                                     llvm::Type *pointerType, llvm::Value *value);
40    size_t getOutputBufferSize(const std::unique_ptr<KernelBuilder> &iBuilder, const std::string& bufferName);
41};
42
43}
44
45
46
47#endif //ICGREP_LZ4D_E_D_H
Note: See TracBrowser for help on using the repository browser.