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

Last change on this file since 5491 was 5491, checked in by cameron, 2 years ago

Update popcount kernel to new Pablo interface

File size: 1.4 KB
RevLine 
[5404]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
[5408]9
[5404]10namespace IDISA { class IDISA_Builder; }
[5408]11namespace re { class RE; }
[5404]12namespace kernel {
13
[5454]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 {
[5404]22public:
[5454]23    ICGrepKernel(const std::unique_ptr<kernel::KernelBuilder> & iBuilder, re::RE * const re_ast);
[5440]24    std::string makeSignature(const std::unique_ptr<kernel::KernelBuilder> & iBuilder) override;
[5431]25    bool isCachable() const override { return true; }
[5436]26protected:
27    void generatePabloMethod() override;
[5404]28};
29
[5413]30class InvertMatchesKernel : public BlockOrientedKernel {
31public:
[5436]32    InvertMatchesKernel(const std::unique_ptr<kernel::KernelBuilder> & builder);
[5413]33private:
[5440]34    void generateDoBlockMethod(const std::unique_ptr<kernel::KernelBuilder> & iBuilder) override;
[5413]35};
36
37
38class PopcountKernel : public pablo::PabloKernel {
39public:
[5436]40    PopcountKernel(const std::unique_ptr<kernel::KernelBuilder> & builder);
[5491]41    bool isCachable() const override { return true; }
42    bool hasSignature() const override { return false; }
43protected:
44    void generatePabloMethod() override;   
[5413]45};
46
[5404]47}
48#endif
Note: See TracBrowser for help on using the repository browser.