Ignore:
Timestamp:
Apr 25, 2018, 2:57:33 PM (13 months ago)
Author:
cameron
Message:

AbortOnNull? functionality - initial check-in

File:
1 edited

Legend:

Unmodified
Added
Removed
  • icGREP/icgrep-devel/icgrep/grep/grep_engine.h

    r5969 r5989  
    2727enum class GrepRecordBreakKind {Null, LF, Unicode};
    2828
    29 class MatchAccumulator {
     29enum GrepSignal : unsigned {BinaryFile};
     30
     31class GrepCallBackObject {
     32public:
     33    GrepCallBackObject() : mBinaryFile(false) {}
     34    virtual void handle_signal(unsigned signal);
     35    bool binaryFileSignalled() {return mBinaryFile;}
     36private:
     37    bool mBinaryFile;
     38};
     39   
     40class MatchAccumulator : public GrepCallBackObject {
    3041public:
    3142    MatchAccumulator() {}
     
    3445};
    3546
     47extern "C" void signal_dispatcher(intptr_t callback_object_addr, unsigned signal);
     48   
    3649extern "C" void accumulate_match_wrapper(intptr_t accum_addr, const size_t lineNum, char * line_start, char * line_end);
    3750
    3851extern "C" void finalize_match_wrapper(intptr_t accum_addr, char * buffer_end);
    39 
    4052
    4153class GrepEngine {
     
    6678    bool searchAllFiles();
    6779    void * DoGrepThreadMethod();
     80    virtual void showResult(uint64_t grepResult, const std::string & fileName, std::ostringstream & strm);
    6881
    6982protected:
    70     std::pair<parabix::StreamSetBuffer *, parabix::StreamSetBuffer *> grepPipeline(parabix::StreamSetBuffer * ByteStream);
     83    std::pair<parabix::StreamSetBuffer *, parabix::StreamSetBuffer *> grepPipeline(parabix::StreamSetBuffer * ByteStream, llvm::Value * callback_object_addr);
    7184
    7285    virtual uint64_t doGrep(const std::string & fileName, std::ostringstream & strm);
     
    145158    CountOnlyEngine();
    146159private:
    147     uint64_t doGrep(const std::string & fileName, std::ostringstream & strm) override;
     160    void showResult(uint64_t grepResult, const std::string & fileName, std::ostringstream & strm) override;
    148161};
    149162
     
    152165    MatchOnlyEngine(bool showFilesWithoutMatch, bool useNullSeparators);
    153166private:
    154     uint64_t doGrep(const std::string & fileName, std::ostringstream & strm) override;
     167    void showResult(uint64_t grepResult, const std::string & fileName, std::ostringstream & strm) override;
    155168    unsigned mRequiredCount;
    156169};
     
    184197   
    185198   
    186 #define MAX_SIMD_WIDTH_SUPPORTED 256
     199#define MAX_SIMD_WIDTH_SUPPORTED 512
    187200#define INITIAL_CAPACITY 64
    188201   
Note: See TracChangeset for help on using the changeset viewer.