source: icGREP/icgrep-devel/icgrep/kernels/grep_kernel.h @ 5501

Last change on this file since 5501 was 5491, checked in by cameron, 23 months ago

Update popcount kernel to new Pablo interface

File size: 1.4 KB
Line 
1/*
2 *  Copyright (c) 2017 International Characters.
3 *  This software is licensed to the public under the Open Software License 3.0.
4 */
5#ifndef GREP_KERNEL_H
6#define GREP_KERNEL_H
7
8#include <pablo/pablo_kernel.h>  // for PabloKernel
9
10namespace IDISA { class IDISA_Builder; }
11namespace re { class RE; }
12namespace kernel {
13
14struct RegularExpressionOptimizer {
15    RegularExpressionOptimizer(re::RE * re_ast);
16protected:
17    re::RE * const  mRE;
18    std::string     mSignature;
19};
20
21class ICGrepKernel : public RegularExpressionOptimizer, public pablo::PabloKernel {
22public:
23    ICGrepKernel(const std::unique_ptr<kernel::KernelBuilder> & iBuilder, re::RE * const re_ast);
24    std::string makeSignature(const std::unique_ptr<kernel::KernelBuilder> & iBuilder) override;
25    bool isCachable() const override { return true; }
26protected:
27    void generatePabloMethod() override;
28};
29
30class InvertMatchesKernel : public BlockOrientedKernel {
31public:
32    InvertMatchesKernel(const std::unique_ptr<kernel::KernelBuilder> & builder);
33private:
34    void generateDoBlockMethod(const std::unique_ptr<kernel::KernelBuilder> & iBuilder) override;
35};
36
37
38class PopcountKernel : public pablo::PabloKernel {
39public:
40    PopcountKernel(const std::unique_ptr<kernel::KernelBuilder> & builder);
41    bool isCachable() const override { return true; }
42    bool hasSignature() const override { return false; }
43protected:
44    void generatePabloMethod() override;   
45};
46
47}
48#endif
Note: See TracBrowser for help on using the repository browser.