source: icGREP/icgrep-devel/icgrep/kernels/s2p_kernel.h @ 6133

Last change on this file since 6133 was 6132, checked in by xwa163, 11 months ago
  1. More experiment on lz4 grep
  2. Improve performance of lzparabix grep
File size: 2.2 KB
Line 
1/*
2 *  Copyright (c) 2018 International Characters.
3 *  This software is licensed to the public under the Open Software License 3.0.
4 */
5#ifndef S2P_KERNEL_H
6#define S2P_KERNEL_H
7
8#include "kernel.h"  // for KernelBuilder
9#include <cc/alphabet.h>
10#include <pablo/pablo_kernel.h>
11#include <string>
12
13namespace IDISA { class IDISA_Builder; }  // lines 14-14
14namespace llvm { class Value; }
15
16namespace kernel {
17
18    class S2P4StreamByPEXTKernel final : public BlockOrientedKernel{
19    public:
20        S2P4StreamByPEXTKernel(const std::unique_ptr<kernel::KernelBuilder> & b);
21    protected:
22        void generateDoBlockMethod(const std::unique_ptr<KernelBuilder> & b) override;
23    };
24
25class S2PKernel final : public MultiBlockKernel {
26public:
27    S2PKernel(const std::unique_ptr<kernel::KernelBuilder> & b, cc::BitNumbering basisNumbering = cc::BitNumbering::LittleEndian, bool aligned = true, std::string prefix = "", unsigned numOfStreams = 8);
28    bool isCachable() const override { return true; }
29    bool hasSignature() const override { return false; }
30protected:
31    void generateMultiBlockLogic(const std::unique_ptr<KernelBuilder> & kb, llvm::Value * const numOfStrides) override;
32private:
33    cc::BitNumbering mBasisSetNumbering;
34    bool mAligned;
35    unsigned mNumOfStreams;
36};
37
38class S2P_21Kernel final : public MultiBlockKernel {
39public:
40    S2P_21Kernel(const std::unique_ptr<kernel::KernelBuilder> & b, cc::BitNumbering basisNumbering = cc::BitNumbering::LittleEndian);
41    bool isCachable() const override { return true; }
42    bool hasSignature() const override { return false; }
43protected:
44    void generateMultiBlockLogic(const std::unique_ptr<KernelBuilder> & kb, llvm::Value * const numOfStrides) override;
45    cc::BitNumbering mBasisSetNumbering;
46};
47
48class S2P_PabloKernel final : public pablo::PabloKernel {
49public:
50    S2P_PabloKernel(const std::unique_ptr<KernelBuilder> & b, unsigned codeUnitWidth = 8, cc::BitNumbering basisNumbering = cc::BitNumbering::LittleEndian);
51    bool isCachable() const override { return true; }
52    bool hasSignature() const override { return false; }
53protected:
54    void generatePabloMethod() override;
55    unsigned mCodeUnitWidth;
56    cc::BitNumbering mBasisSetNumbering;
57};
58
59
60}
61#endif
Note: See TracBrowser for help on using the repository browser.