Ignore:
Timestamp:
Aug 28, 2017, 4:00:17 PM (2 years ago)
Author:
nmedfort
Message:

Bug fixes for multigrep mode. Optional PabloKernel? branch hit counter added. Minor optimizations.

File:
1 edited

Legend:

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

    r5597 r5620  
    305305
    306306   
    307 std::pair<StreamSetBuffer *, StreamSetBuffer *> grepPipeline(Driver * grepDriver, std::vector<re::RE *> REs, const GrepModeType grepMode, unsigned encodingBits, StreamSetBuffer * ByteStream) {
     307std::pair<StreamSetBuffer *, StreamSetBuffer *> grepPipeline(Driver * grepDriver, std::vector<re::RE *> & REs, const GrepModeType grepMode, unsigned encodingBits, StreamSetBuffer * ByteStream) {
    308308    auto & idb = grepDriver->getBuilder();
    309309    const unsigned segmentSize = codegen::SegmentSize;
     
    334334        std::vector<std::vector<unsigned>> exclusiveSetIDs;
    335335        std::vector<UCD::UnicodeSet> multiplexedCCs;
    336 
    337336        doMultiplexCCs(UnicodeSets, exclusiveSetIDs, multiplexedCCs);
    338 
    339         REs[i] = multiplex(REs[i], UnicodeSets, exclusiveSetIDs, multiplexedCCs);
     337        REs[i] = multiplex(REs[i], UnicodeSets, exclusiveSetIDs);
    340338        charclasses.push_back(multiplexedCCs);
    341339    }
     
    344342
    345343    for(unsigned i = 0; i < n; ++i){
    346         StreamSetBuffer * CharClasses = grepDriver->addBuffer(make_unique<CircularBuffer>(idb, idb->getStreamSetTy(charclasses[i].size()), segmentSize * bufferSegments));
    347         kernel::Kernel * ccK = grepDriver->addKernelInstance(make_unique<kernel::CharClassesKernel>(idb, charclasses[i]));
    348         ccK->setName("cc" + std::to_string(i));
     344        const auto numOfCharacterClasses = charclasses[i].size();
     345        StreamSetBuffer * CharClasses = grepDriver->addBuffer(make_unique<CircularBuffer>(idb, idb->getStreamSetTy(numOfCharacterClasses), segmentSize * bufferSegments));
     346        kernel::Kernel * ccK = grepDriver->addKernelInstance(make_unique<kernel::CharClassesKernel>(idb, std::move(charclasses[i])));
    349347        grepDriver->makeKernelCall(ccK, {BasisBits}, {CharClasses});
    350348        StreamSetBuffer * MatchResults = grepDriver->addBuffer(make_unique<CircularBuffer>(idb, idb->getStreamSetTy(1, 1), segmentSize * bufferSegments));
    351         kernel::Kernel * icgrepK = grepDriver->addKernelInstance(make_unique<kernel::ICGrepKernel>(idb, REs[i], true, charclasses[i].size()));
     349        kernel::Kernel * icgrepK = grepDriver->addKernelInstance(make_unique<kernel::ICGrepKernel>(idb, REs[i], true, numOfCharacterClasses));
    352350        grepDriver->makeKernelCall(icgrepK, {CharClasses, LineBreakStream, RequiredStreams}, {MatchResults});
    353351        MatchResultsBufs[i] = MatchResults;
Note: See TracChangeset for help on using the changeset viewer.