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

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

Optimized Symbol Generation (and fixed potential bug that could allow duplicate names being constructed); made PabloKernel? extend PabloAST (temporarily removed PabloAST::getName() to avoid diamond problem); added an internal scalar to PabloKernel? struct for each Count to avoid InOut? output scalar variable problem; allowed CodeMotionPass? to move code within the same scope but across a branch statement. Began work on separating Kernels into either Block-Oriented or Segment-Oriented kernels.

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 DirectCharacterClassKernelBuilder : public BlockOrientedKernel {
18public:
19   
20    DirectCharacterClassKernelBuilder(IDISA::IDISA_Builder * iBuilder, std::string ccSetName, std::vector<re::CC *> charClasses, unsigned codeUnitSize)
21    : BlockOrientedKernel(iBuilder, std::move(ccSetName),
22                  {Binding{iBuilder->getStreamSetTy(1, 8 * codeUnitSize), "codeUnitStream"}},
23                  {Binding{iBuilder->getStreamSetTy(charClasses.size(), 1), "ccStream"}},
24                  {}, {}, {})
25    , mCharClasses(charClasses)
26    , mCodeUnitSize(codeUnitSize) {
27    }
28   
29    void generateDoBlockMethod() const override;
30
31private:
32    std::vector<re::CC *> mCharClasses;
33    unsigned mCodeUnitSize;
34   
35};
36
37class ParabixCharacterClassKernelBuilder: public pablo::PabloKernel {
38public:
39    ParabixCharacterClassKernelBuilder(IDISA::IDISA_Builder * iBuilder, std::string ccSetName, const std::vector<re::CC *> & charClasses, unsigned basisBitsCount);
40};
41
42}
43#endif
Note: See TracBrowser for help on using the repository browser.