Ignore:
Timestamp:
Aug 26, 2016, 9:33:51 AM (3 years ago)
Author:
cameron
Message:

Defer binding of buffers to stream sets until kernel generation

File:
1 edited

Legend:

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

    r5130 r5133  
    155155    CircularBuffer MatchResults(iBuilder, StreamSetType(2, i1), segmentSize);
    156156
    157     kernel::s2pKernel  s2pk(iBuilder, ByteStream, BasisBits);
    158     s2pk.generateKernel();
     157    kernel::s2pKernel  s2pk(iBuilder);
     158    s2pk.generateKernel({&ByteStream}, {&BasisBits});
    159159
    160160    re_ast = re::regular_expression_passes(encoding, re_ast);   
    161161    pablo::PabloFunction * function = re::re2pablo_compiler(encoding, re_ast);
    162162    pablo_function_passes(function);
    163     pablo::PabloKernel  icgrepK(iBuilder, "icgrep", function, BasisBits, MatchResults, {"matchedLineCount"});
    164     icgrepK.generateKernel();
     163    pablo::PabloKernel  icgrepK(iBuilder, "icgrep", function, {"matchedLineCount"});
     164    icgrepK.generateKernel({&BasisBits}, {&MatchResults});
    165165
    166166    ByteStream.setStreamSetBuffer(inputStream);
     
    168168    MatchResults.allocateBuffer();
    169169   
    170     Value * s2pInstance = s2pk.createInstance({}, {&ByteStream}, {&BasisBits});
    171     Value * icgrepInstance = icgrepK.createInstance({}, {&BasisBits}, {&MatchResults});
     170    Value * s2pInstance = s2pk.createInstance({});
     171    Value * icgrepInstance = icgrepK.createInstance({});
    172172   
    173173    if (CountOnly) {
     
    177177    }
    178178    else {
    179         kernel::scanMatchKernel scanMatchK(iBuilder, MatchResults, mIsNameExpression);
    180         scanMatchK.generateKernel();
     179        kernel::scanMatchKernel scanMatchK(iBuilder, mIsNameExpression);
     180        scanMatchK.generateKernel({&MatchResults}, {});
    181181               
    182         Value * scanMatchInstance = scanMatchK.createInstance({iBuilder->CreateBitCast(inputStream, int8PtrTy), fileSize, fileIdx}, {&MatchResults}, {});
     182        Value * scanMatchInstance = scanMatchK.createInstance({iBuilder->CreateBitCast(inputStream, int8PtrTy), fileSize, fileIdx});
    183183       
    184184        generatePipelineLoop(iBuilder, {&s2pk, &icgrepK, &scanMatchK}, {s2pInstance, icgrepInstance, scanMatchInstance}, fileSize);
Note: See TracChangeset for help on using the changeset viewer.