source: icGREP/icgrep-devel/icgrep/kernels/lz4/lz4_swizzled_match_copy_kernel.h @ 5974

Last change on this file since 5974 was 5974, checked in by xwa163, 17 months ago
  1. Use i1 bit stream instead of i64 number stream in M0 related streams and Match Offset related stream
  2. Improve the performance of lz4_index_builder
File size: 1.4 KB
Line 
1//
2// Created by wxy325 on 2018/3/9.
3//
4
5#ifndef ICGREP_LZ4_SWIZZLED_MATCH_COPY_KERNEL_H
6#define ICGREP_LZ4_SWIZZLED_MATCH_COPY_KERNEL_H
7
8#include "kernels/kernel.h"
9
10namespace IDISA { class IDISA_Builder; }
11
12
13namespace kernel {
14    class LZ4SwizzledMatchCopyKernel: public SegmentOrientedKernel {
15    public:
16        LZ4SwizzledMatchCopyKernel(const std::unique_ptr<kernel::KernelBuilder> & iBuilder, unsigned streamCount, unsigned streamSize, unsigned swizzleFactor, unsigned PDEP_width = 64);
17    protected:
18
19        void generateDoSegmentMethod(const std::unique_ptr<KernelBuilder> & b) override;
20
21        void generateOutputCopy(const std::unique_ptr<KernelBuilder> & iBuilder);
22
23        llvm::Value * loadOffset(const std::unique_ptr<KernelBuilder> &iBuilder, const std::string & bufferName, llvm::Value* offset);
24
25    private:
26
27        const unsigned mSwizzleFactor;
28        const unsigned mPDEPWidth;
29        const unsigned mStreamSize;
30        const unsigned mStreamCount;
31        llvm::Value* loadNextMatchOffset(const std::unique_ptr<KernelBuilder> &iBuilder);
32        std::pair<llvm::Value*, llvm::Value*> loadNextM0StartEnd(const std::unique_ptr<KernelBuilder> &iBuilder);
33        llvm::Value *advanceUntilNextBit(const std::unique_ptr<KernelBuilder> &iBuilder, std::string inputName,
34                                          llvm::Value *startPos, bool isNextOne);
35
36    };
37}
38
39
40
41
42#endif //ICGREP_LZ4_SWIZZLED_MATCH_COPY_KERNEL_H
Note: See TracBrowser for help on using the repository browser.