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

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

Initial work on adding types to PabloAST and mutable Var objects.

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 "streamset.h"
9#include "interface.h"
10#include "kernel.h"
11#include <re/re_cc.h>
12#include <pablo/pablo_kernel.h>
13#include <cc/cc_compiler.h>
14
15namespace kernel {
16
17class KernelBuilder;
18
19
20
21class DirectCharacterClassKernelBuilder : public KernelBuilder {
22public:
23   
24    DirectCharacterClassKernelBuilder(IDISA::IDISA_Builder * iBuilder, std::string ccSetName, std::vector<re::CC *> charClasses, unsigned codeUnitSize) :
25    KernelBuilder(iBuilder, "cc",
26                  {Binding{parabix::StreamSetType(iBuilder,1, 8 * codeUnitSize), "codeUnitStream"}},
27                  {Binding{parabix::StreamSetType(iBuilder,charClasses.size(), 1), "ccStream"}},
28                  {}, {}, {}), mCharClasses(charClasses), mCodeUnitSize(codeUnitSize) {}
29   
30   
31private:
32    void generateDoBlockMethod() override;
33    std::vector<re::CC *> mCharClasses;
34    unsigned mCodeUnitSize;
35   
36};
37   
38   
39
40class ParabixCharacterClassKernelBuilder: public pablo::PabloKernel {
41public:
42    ParabixCharacterClassKernelBuilder(IDISA::IDISA_Builder * iBuilder, std::string ccSetName, std::vector<re::CC *> charClasses, unsigned basisBitsCount) :
43        PabloKernel(iBuilder, ccSetName +"_kernel", cc::ParabixCharacterClassFunction(ccSetName, charClasses, basisBitsCount)) {}
44   
45};
46 
47
48}
49#endif
Note: See TracBrowser for help on using the repository browser.