Ignore:
Timestamp:
Aug 26, 2016, 12:48:42 PM (3 years ago)
Author:
cameron
Message:

refine PabloKernel? signature based on CountOnly? parameter

File:
1 edited

Legend:

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

    r5133 r5134  
    153153    ExternalUnboundedBuffer ByteStream(iBuilder, StreamSetType(1, i8));
    154154    CircularBuffer BasisBits(iBuilder, StreamSetType(8, i1), segmentSize);
    155     CircularBuffer MatchResults(iBuilder, StreamSetType(2, i1), segmentSize);
    156155
    157156    kernel::s2pKernel  s2pk(iBuilder);
     
    159158
    160159    re_ast = re::regular_expression_passes(encoding, re_ast);   
    161     pablo::PabloFunction * function = re::re2pablo_compiler(encoding, re_ast);
     160    pablo::PabloFunction * function = re::re2pablo_compiler(encoding, re_ast, CountOnly);
    162161    pablo_function_passes(function);
    163     pablo::PabloKernel  icgrepK(iBuilder, "icgrep", function, {"matchedLineCount"});
    164     icgrepK.generateKernel({&BasisBits}, {&MatchResults});
    165 
    166     ByteStream.setStreamSetBuffer(inputStream);
    167     BasisBits.allocateBuffer();
    168     MatchResults.allocateBuffer();
    169    
    170     Value * s2pInstance = s2pk.createInstance({});
    171     Value * icgrepInstance = icgrepK.createInstance({});
    172162   
    173163    if (CountOnly) {
     164        pablo::PabloKernel  icgrepK(iBuilder, "icgrep", function, {"matchedLineCount"});
     165        icgrepK.generateKernel({&BasisBits}, {});
     166
     167        ByteStream.setStreamSetBuffer(inputStream);
     168        BasisBits.allocateBuffer();
     169       
     170        Value * s2pInstance = s2pk.createInstance({});
     171        Value * icgrepInstance = icgrepK.createInstance({});
     172       
    174173        generatePipelineLoop(iBuilder, {&s2pk, &icgrepK}, {s2pInstance, icgrepInstance}, fileSize);
    175174        Value * matchCount = icgrepK.createGetAccumulatorCall(icgrepInstance, "matchedLineCount");
     
    177176    }
    178177    else {
     178        CircularBuffer MatchResults(iBuilder, StreamSetType(2, i1), segmentSize);
     179        pablo::PabloKernel  icgrepK(iBuilder, "icgrep", function, {});
     180        icgrepK.generateKernel({&BasisBits},  {&MatchResults});
     181
     182        ByteStream.setStreamSetBuffer(inputStream);
     183        BasisBits.allocateBuffer();
     184        MatchResults.allocateBuffer();
     185       
     186        Value * s2pInstance = s2pk.createInstance({});
     187        Value * icgrepInstance = icgrepK.createInstance({});
    179188        kernel::scanMatchKernel scanMatchK(iBuilder, mIsNameExpression);
    180189        scanMatchK.generateKernel({&MatchResults}, {});
Note: See TracChangeset for help on using the changeset viewer.