Changeset 5697


Ignore:
Timestamp:
Oct 18, 2017, 7:09:02 PM (16 months ago)
Author:
cameron
Message:

Some tidying up

Location:
icGREP/icgrep-devel/icgrep
Files:
1 deleted
4 edited

Legend:

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

    r5696 r5697  
    233233
    234234   
    235 std::pair<StreamSetBuffer *, StreamSetBuffer *> grepPipeline(Driver * grepDriver, std::vector<re::RE *> & REs, const GrepModeType grepMode, unsigned encodingBits, StreamSetBuffer * ByteStream) {
     235std::pair<StreamSetBuffer *, StreamSetBuffer *> grepPipeline(Driver * grepDriver, std::vector<re::RE *> & REs, const GrepModeType grepMode, StreamSetBuffer * ByteStream) {
    236236    auto & idb = grepDriver->getBuilder();
    237237    const unsigned segmentSize = codegen::SegmentSize;
    238238    const unsigned bufferSegments = codegen::BufferSegments * codegen::ThreadNum;
    239     size_t MatchLimit = ((grepMode == QuietMode) | (grepMode == FilesWithMatch) | (grepMode == FilesWithoutMatch)) ? 1 : MaxCountFlag;
    240    
     239    const unsigned encodingBits = 8;
    241240
    242241    StreamSetBuffer * BasisBits = grepDriver->addBuffer(make_unique<CircularBuffer>(idb, idb->getStreamSetTy(encodingBits, 1), segmentSize * bufferSegments));
     
    297296        grepDriver->makeKernelCall(invertK, {OriginalMatches, LineBreakStream}, {Matches});
    298297    }
    299     if (MatchLimit > 0) {
     298    if (MaxCountFlag > 0) {
    300299        kernel::Kernel * untilK = grepDriver->addKernelInstance(make_unique<kernel::UntilNkernel>(idb));
    301         untilK->setInitialArguments({idb->getSize(MatchLimit)});
     300        untilK->setInitialArguments({idb->getSize(MaxCountFlag)});
    302301        StreamSetBuffer * AllMatches = Matches;
    303302        Matches = grepDriver->addBuffer(make_unique<CircularBuffer>(idb, idb->getStreamSetTy(1, 1), segmentSize * bufferSegments));
     
    327326    match_accumulator->setName("match_accumulator");
    328327
    329     StreamSetBuffer * ByteStream = mGrepDriver->addBuffer(make_unique<SourceBuffer>(idb, idb->getStreamSetTy(1, 8)));
     328    StreamSetBuffer * ByteStream = mGrepDriver->addBuffer(make_unique<SourceBuffer>(idb, idb->getStreamSetTy(1, encodingBits)));
    330329    kernel::Kernel * sourceK = mGrepDriver->addKernelInstance(make_unique<kernel::FDSourceKernel>(idb, segmentSize));
    331330    sourceK->setInitialArguments({fileDescriptor});
     
    334333    StreamSetBuffer * LineBreakStream;
    335334    StreamSetBuffer * Matches;
    336     std::tie(LineBreakStream, Matches) = grepPipeline(mGrepDriver, REs, grepMode, encodingBits, ByteStream);
     335    std::tie(LineBreakStream, Matches) = grepPipeline(mGrepDriver, REs, grepMode, ByteStream);
    337336   
    338337    if (grepMode == NormalMode) {
  • icGREP/icgrep-devel/icgrep/grep_engine.h

    r5696 r5697  
    77#define GREP_ENGINE_H
    88#include <grep_interface.h>
    9 #include <grep_type.h>  // for GrepType, GrepType::Normal
    109#include <toolchain/grep_pipeline.h>
    1110#include <string>       // for string
    1211#include <vector>
    13 #include <re/re_parser.h>
    14 #include <re/re_multiplex.h>
    1512#include <sstream>
    1613#include <mutex>
  • icGREP/icgrep-devel/icgrep/grep_interface.cpp

    r5486 r5697  
    307307        llvm::report_fatal_error("Sorry, -color is not yet supported.\n");
    308308    }
     309    if ((Mode == QuietMode) | (Mode == FilesWithMatch) | (Mode == FilesWithoutMatch)) {
     310        MaxCountFlag = 1;
     311    }
    309312}
    310313}
  • icGREP/icgrep-devel/icgrep/kernels/scanmatchgen.h

    r5695 r5697  
    66#define SCANMATCHGEN_H
    77
    8 #include "grep_type.h"
    98#include "kernel.h"
    109namespace IDISA { class IDISA_Builder; }
Note: See TracChangeset for help on using the changeset viewer.