Ignore:
Timestamp:
Jul 20, 2016, 10:06:34 AM (3 years ago)
Author:
cameron
Message:

Buffer class hierarchy; s2p kernel demonstrates specialization for different buffer strategies

File:
1 edited

Legend:

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

    r5087 r5100  
    118118}
    119119
     120using namespace parabix;
    120121
    121122void GrepEngine::grepCodeGen(std::string moduleName, re::RE * re_ast, bool CountOnly, bool UTF_16, bool isNameExpression) {
     
    125126    IDISA::IDISA_Builder * iBuilder = IDISA::GetIDISA_Builder(M);
    126127
     128    const unsigned segmentSize = codegen::SegmentSize;
    127129
    128130    Encoding::Type type;
     
    133135    Encoding encoding(type, bits);
    134136
     137    ExternalUnboundedBuffer ByteStream(iBuilder, StreamSetType(1, i8));
     138    CircularBuffer BasisBits(iBuilder, StreamSetType(8, i1), segmentSize);
     139
    135140    mIsNameExpression = isNameExpression;
    136141    re_ast = re::regular_expression_passes(encoding, re_ast);   
    137142    pablo::PabloFunction * function = re::re2pablo_compiler(encoding, re_ast);
    138143   
    139     kernel::s2pKernel  s2pk(iBuilder);
     144    kernel::s2pKernel  s2pk(iBuilder, ByteStream, BasisBits);
    140145    kernel::scanMatchKernel scanMatchK(iBuilder, 64, false);
    141146   
     
    172177    fileIdx->setName("fileIdx");
    173178
    174     const unsigned segmentSize = codegen::SegmentSize;
    175 
    176     kernel::StreamSetBuffer ByteStream(iBuilder, kernel::StreamSetType(1, (UTF_16 ? 16 : 8)), 0);
    177     kernel::StreamSetBuffer BasisBits(iBuilder, kernel::StreamSetType((UTF_16 ? 16 : 8), 1), segmentSize);
     179
    178180    ByteStream.setStreamSetBuffer(inputStream);
    179181    BasisBits.allocateBuffer();
     
    188190    }
    189191    else {
    190         kernel::StreamSetBuffer MatchResults(iBuilder, kernel::StreamSetType(2, 1), segmentSize);
     192       
     193        CircularBuffer MatchResults(iBuilder, StreamSetType(2, i1), segmentSize);
    191194        ByteStream.setStreamSetBuffer(inputStream);
    192195        BasisBits.allocateBuffer();
Note: See TracChangeset for help on using the changeset viewer.