Changeset 5404 for icGREP


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

Grep kernels with signatures and object caching

Location:
icGREP/icgrep-devel/icgrep
Files:
2 added
4 edited

Legend:

Unmodified
Added
Removed
  • icGREP/icgrep-devel/icgrep/CMakeLists.txt

    r5402 r5404  
    8787target_link_libraries (RegExpCompiler RegExpADT)
    8888
    89 add_executable(icgrep icgrep.cpp grep_engine.cpp kernels/scanmatchgen.cpp kernels/cc_kernel.cpp kernels/cc_scan_kernel.cpp kernels/linebreak_kernel.cpp kernels/streams_merge.cpp kernels/match_count.cpp)
     89add_executable(icgrep icgrep.cpp grep_engine.cpp kernels/scanmatchgen.cpp kernels/cc_kernel.cpp kernels/cc_scan_kernel.cpp kernels/linebreak_kernel.cpp kernels/streams_merge.cpp kernels/match_count.cpp kernels/grep_kernel.cpp)
    9090add_executable(u8u16 u8u16.cpp)
    9191add_executable(base64 base64.cpp kernels/radix64.cpp)
  • 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
  • icGREP/icgrep-devel/icgrep/pablo/pablo_kernel.h

    r5398 r5404  
    129129    // so that the carry data requirements may be accommodated before
    130130    // finalizing the KernelStateType.
    131     void prepareKernel()  override final;
     131    void prepareKernel()  override;
    132132
    133133    void generateDoBlockMethod() override final;
  • icGREP/icgrep-devel/icgrep/re/re_compiler.cpp

    r5401 r5404  
    205205    PabloAST * matches = mPB.createAnd(match_follow, mLineBreak, "matches");
    206206    if (mCountOnly) {
    207         Var * const output = mKernel->addOutput("matchedLineCount", mKernel->getSizeTy());
     207        Var * const output = mKernel->getOutputScalarVar("matchedLineCount");
    208208        PabloBuilder nestedCount = PabloBuilder::Create(mPB);
    209209        mPB.createIf(matches, nestedCount);
    210210        nestedCount.createAssign(output, nestedCount.createCount(matches));
    211211    } else {
    212         Var * const output = mKernel->addOutput("output", mKernel->getStreamSetTy(1));
     212        Var * const output = mKernel->getOutputStreamVar("matches");
    213213        mPB.createAssign(mPB.createExtract(output, mPB.getInteger(0)), matches);
    214214    }
Note: See TracChangeset for help on using the changeset viewer.