Ignore:
Timestamp:
Apr 11, 2017, 5:13:07 PM (2 years ago)
Author:
cameron
Message:

Grep kernels with signatures and object caching

File:
1 edited

Legend:

Unmodified
Added
Removed
  • icGREP/icgrep-devel/icgrep/grep_engine.cpp

    r5402 r5404  
    1717#include <UCD/resolve_properties.h>
    1818#include <kernels/cc_kernel.h>
     19#include <kernels/grep_kernel.h>
    1920#include <kernels/linebreak_kernel.h>
    2021#include <kernels/streams_merge.h>
     
    2526#include <kernels/streamset.h>
    2627#include <kernels/stdin_kernel.h>
    27 #include <pablo/pablo_compiler.h>
    2828#include <pablo/pablo_kernel.h>
    29 #include <pablo/pablo_toolchain.h>
    3029#include <re/re_cc.h>
    3130#include <re/re_toolchain.h>
     
    517516
    518517    pxDriver.addKernelCall(linebreakK, {&BasisBits}, {&LineBreakStream});
    519 
    520     pablo::PabloKernel icgrepK(iBuilder, "icgrep", {Binding{iBuilder->getStreamSetTy(8), "basis"}, Binding{iBuilder->getStreamSetTy(1, 1), "linebreak"}});
    521     re::re2pablo_compiler(&icgrepK, re::regular_expression_passes(re_ast), CountOnly);
    522     pablo_function_passes(&icgrepK);
     518   
     519    kernel::ICgrepKernelBuilder icgrepK(iBuilder, re_ast, CountOnly);
    523520
    524521    if (CountOnly) {
    525 
     522       
    526523        pxDriver.addKernelCall(icgrepK, {&BasisBits, &LineBreakStream}, {});
    527524
     
    545542            iBuilder->CreateRetVoid();
    546543
    547             pxDriver.JITcompileMain();
    548544            pxDriver.linkAndFinalize();
    549545        }
     
    663659
    664660    for(unsigned i = 0; i < REs.size(); ++i){
    665         pablo::PabloKernel * const icgrepK = new pablo::PabloKernel(iBuilder, "icgrep" + std::to_string(i), {Binding{iBuilder->getStreamSetTy(8), "basis"}, Binding{iBuilder->getStreamSetTy(1, 1), "linebreak"}});
    666         re::re2pablo_compiler(icgrepK, re::regular_expression_passes(REs[i]), false);
    667         pablo_function_passes(icgrepK);
    668         CircularBuffer * const matchResults = new CircularBuffer(iBuilder, iBuilder->getStreamSetTy(2, 1), segmentSize * bufferSegments);
     661        pablo::PabloKernel * const icgrepK = new kernel::ICgrepKernelBuilder(iBuilder, REs[i], false);
     662        CircularBuffer * const matchResults = new CircularBuffer(iBuilder, iBuilder->getStreamSetTy(1, 1), segmentSize * bufferSegments);
    669663        matchResults->allocateBuffer();
    670664
Note: See TracChangeset for help on using the changeset viewer.