Ignore:
Timestamp:
May 7, 2017, 4:34:48 PM (2 years ago)
Author:
nmedfort
Message:

Continued refactoring work. PabloKernel? now abstract base type with a 'generatePabloMethod' hook to generate Pablo code.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • icGREP/icgrep-devel/icgrep/kernels/cc_kernel.cpp

    r5435 r5436  
    88#include <cc/cc_compiler.h>
    99#include <pablo/builder.hpp>
    10 #include <llvm/IR/Module.h>
     10#include <kernels/kernel_builder.h>
    1111
    1212using namespace cc;
     
    1717
    1818DirectCharacterClassKernelBuilder::DirectCharacterClassKernelBuilder(
    19         const std::unique_ptr<IDISA::IDISA_Builder> & b, std::string ccSetName, std::vector<re::CC *> charClasses, unsigned codeUnitSize)
     19        const std::unique_ptr<kernel::KernelBuilder> & b, std::string ccSetName, std::vector<re::CC *> charClasses, unsigned codeUnitSize)
    2020: BlockOrientedKernel(std::move(ccSetName),
    2121              {Binding{b->getStreamSetTy(1, 8 * codeUnitSize), "codeUnitStream"}},
     
    7171
    7272ParabixCharacterClassKernelBuilder::ParabixCharacterClassKernelBuilder (
    73         const std::unique_ptr<IDISA::IDISA_Builder> & b, std::string ccSetName, const std::vector<CC *> & charClasses, unsigned codeUnitSize)
     73        const std::unique_ptr<kernel::KernelBuilder> & b, std::string ccSetName, const std::vector<CC *> & charClasses, unsigned codeUnitSize)
    7474: PabloKernel(b, ccSetName +"_kernel", {Binding{b->getStreamSetTy(codeUnitSize), "basis"}})
    7575, mCharClasses(charClasses) {
     
    7979}
    8080
    81 void ParabixCharacterClassKernelBuilder::prepareKernel() {
     81void ParabixCharacterClassKernelBuilder::generatePabloMethod() {
    8282    CC_Compiler ccc(this, getInput(0));
    8383    auto & builder = ccc.getBuilder();
     
    8585        builder.createAssign(getOutput(i), ccc.compileCC("cc", mCharClasses[i], builder));
    8686    }
    87     PabloKernel::prepareKernel();
    8887}
Note: See TracChangeset for help on using the changeset viewer.