source: icGREP/icgrep-devel/icgrep/kernels/charclasses.h

Last change on this file was 6184, checked in by nmedfort, 9 months ago

Initial version of PipelineKernel? + revised StreamSet? model.

File size: 1.9 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 CHARCLASSES_H
6#define CHARCLASSES_H
7
8#include <pablo/pablo_kernel.h>  // for PabloKernel
9#include <cc/alphabet.h>
10
11namespace kernel { class KernelBuilder; }
12namespace IDISA { class IDISA_Builder; }
13namespace re { class RE; class CC; }
14namespace kernel {
15
16struct CharClassesSignature {
17    CharClassesSignature(const std::vector<re::CC *> & ccs, bool useDirectCC, cc::BitNumbering basisNumbering);
18protected:
19    const bool mUseDirectCC;
20    const std::string mSignature;
21};
22
23class CharClassesKernel : public CharClassesSignature, public pablo::PabloKernel {
24public:
25    CharClassesKernel(const std::unique_ptr<kernel::KernelBuilder> & iBuilder, std::vector<re::CC *> && ccs, StreamSet * BasisBits, StreamSet * CharClasses, cc::BitNumbering basisNumbering = cc::BitNumbering::LittleEndian);
26    bool hasSignature() const override { return true; }
27    std::string makeSignature(const std::unique_ptr<kernel::KernelBuilder> &) override;
28    bool isCachable() const override { return true; }
29protected:
30    void generatePabloMethod() override;
31protected:
32    std::vector<re::CC *> mCCs;
33    cc::BitNumbering mBasisSetNumbering;
34
35};
36
37
38class ByteClassesKernel: public CharClassesSignature, public pablo::PabloKernel {
39public:
40    ByteClassesKernel(const std::unique_ptr<kernel::KernelBuilder> & iBuilder, std::vector<re::CC *> && ccs, StreamSet * inputStream, StreamSet * CharClasses, cc::BitNumbering basisNumbering = cc::BitNumbering::LittleEndian);
41    bool hasSignature() const override { return true; }
42    std::string makeSignature(const std::unique_ptr<kernel::KernelBuilder> &) override;
43    bool isCachable() const override { return true; }
44protected:
45    void generatePabloMethod() override;
46protected:
47    std::vector<re::CC *> mCCs;
48    cc::BitNumbering mBasisSetNumbering;
49};
50
51
52}
53#endif
Note: See TracBrowser for help on using the repository browser.