source: icGREP/icgrep-devel/icgrep/kernels/cc_kernel.h @ 5267

Last change on this file since 5267 was 5267, checked in by nmedfort, 2 years ago

Code clean-up. Removed Pablo Call, SetIthBit? and Prototype.

File size: 1.4 KB
Line 
1/*
2 *  Copyright (c) 2016 International Characters.
3 *  This software is licensed to the public under the Open Software License 3.0.
4 */
5#ifndef CC_KERNEL_H
6#define CC_KERNEL_H
7
8#include <pablo/pablo_kernel.h>  // for PabloKernel
9#include "kernel.h"              // for KernelBuilder
10#include <vector>                // for vector
11#include <string>                // for string
12namespace IDISA { class IDISA_Builder; }
13namespace re { class CC; }
14
15namespace kernel {
16
17class KernelBuilder;
18
19class DirectCharacterClassKernelBuilder : public KernelBuilder {
20public:
21   
22    DirectCharacterClassKernelBuilder(IDISA::IDISA_Builder * iBuilder, std::string ccSetName, std::vector<re::CC *> charClasses, unsigned codeUnitSize)
23    : KernelBuilder(iBuilder, std::move(ccSetName),
24                  {Binding{iBuilder->getStreamSetTy(1, 8 * codeUnitSize), "codeUnitStream"}},
25                  {Binding{iBuilder->getStreamSetTy(charClasses.size(), 1), "ccStream"}},
26                  {}, {}, {})
27    , mCharClasses(charClasses)
28    , mCodeUnitSize(codeUnitSize) {
29    }
30   
31   
32private:
33    void generateDoBlockMethod() const override;
34    std::vector<re::CC *> mCharClasses;
35    unsigned mCodeUnitSize;
36   
37};
38
39class ParabixCharacterClassKernelBuilder: public pablo::PabloKernel {
40public:
41    ParabixCharacterClassKernelBuilder(IDISA::IDISA_Builder * iBuilder, std::string ccSetName, const std::vector<re::CC *> & charClasses, unsigned basisBitsCount);
42};
43
44}
45#endif
Note: See TracBrowser for help on using the repository browser.