source: icGREP/icgrep-devel/icgrep/kernels/lz4/lz4_block_decoder_new.h @ 5921

Last change on this file since 5921 was 5921, checked in by xwa163, 13 months ago
  1. Initial checkin for new approach for lz4 index decoder that always use 4MB buffer
  2. Add test case for new approach (for now test cases will fail when test file is larger than 4MB)
File size: 1.2 KB
Line 
1//
2// Created by wxy325 on 2018/3/16.
3//
4
5#ifndef ICGREP_LZ4_BLOCK_DECODER_NEW_H
6#define ICGREP_LZ4_BLOCK_DECODER_NEW_H
7
8
9#include "kernels/kernel.h"
10
11namespace llvm {
12    class Module;
13    class Function;
14    class BasicBlock;
15    class Value;
16}
17
18namespace IDISA { class IDISA_Builder; }
19
20namespace kernel {
21
22class LZ4BlockDecoderNewKernel final : public MultiBlockKernel {
23
24public:
25    LZ4BlockDecoderNewKernel(const std::unique_ptr<kernel::KernelBuilder> &iBuilder);
26
27protected:
28    void generateMultiBlockLogic(const std::unique_ptr<KernelBuilder> &iBuilder, llvm::Value * const numOfStrides) override;
29
30private:
31    llvm::Value *generateLoadInput(const std::unique_ptr<KernelBuilder> &iBuilder, llvm::Value *offset);
32
33    void appendOutput(const std::unique_ptr<KernelBuilder> & iBuilder, llvm::Value *isCompressed, llvm::Value *blockStart, llvm::Value *blockEnd);
34
35    void generateStoreCircularOutput(const std::unique_ptr<KernelBuilder> &iBuilder, const std::string& outputBufferName,
36                                     llvm::Type *pointerType, llvm::Value *value);
37    size_t getOutputBufferSize(const std::unique_ptr<KernelBuilder> &iBuilder, const std::string& bufferName);
38};
39
40}
41
42
43#endif //ICGREP_LZ4_BLOCK_DECODER_NEW_H
Note: See TracBrowser for help on using the repository browser.