Ignore:
Timestamp:
Oct 18, 2017, 9:35:52 AM (19 months ago)
Author:
cameron
Message:

Update scanmatch callback protocol to use line start/end pointers; add finalize callback for buffer end

Location:
icGREP/icgrep-devel/icgrep/toolchain
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • icGREP/icgrep-devel/icgrep/toolchain/grep_pipeline.cpp

    r5679 r5694  
    2727
    2828namespace grep {
     29void accumulate_match_wrapper(intptr_t accum_addr, const size_t lineNum, char * line_start, char * line_end) {
     30    reinterpret_cast<MatchAccumulator *>(accum_addr)->accumulate_match(lineNum, line_start, line_end);
     31}
    2932
    30    
    31 void accumulate_match_wrapper(intptr_t accum_addr, const size_t lineNum, size_t line_start, size_t line_end) {
    32     reinterpret_cast<MatchAccumulator *>(accum_addr)->accumulate_match(lineNum, line_start, line_end);
     33void finalize_match_wrapper(intptr_t accum_addr, char * buffer_end) {
     34    reinterpret_cast<MatchAccumulator *>(accum_addr)->finalize_match(buffer_end);
    3335}
    3436
     
    8082    pxDriver.makeKernelCall(scanMatchK, {MatchedLines, LineBreakStream, ByteStream}, {});
    8183    pxDriver.LinkFunction(*scanMatchK, "accumulate_match_wrapper", &accumulate_match_wrapper);
     84    pxDriver.LinkFunction(*scanMatchK, "finalize_match_wrapper", &finalize_match_wrapper);
    8285    pxDriver.generatePipelineIR();
    8386    pxDriver.deallocateBuffers();
  • icGREP/icgrep-devel/icgrep/toolchain/grep_pipeline.h

    r5679 r5694  
    1717public:
    1818    MatchAccumulator() {};
    19     virtual void accumulate_match(const size_t lineNum, size_t line_start, size_t line_end) = 0;
     19    virtual void accumulate_match(const size_t lineNum, char * line_start, char * line_end) = 0;
     20    virtual void finalize_match(char * buffer_end) {}  // default: no op
    2021};
    2122
    22 void accumulate_match_wrapper(intptr_t accum_addr, const size_t lineNum, size_t line_start, size_t line_end);
     23void accumulate_match_wrapper(intptr_t accum_addr, const size_t lineNum, char * line_start, char * line_end);
    2324   
    2425void grepBuffer(re::RE * pattern, const char * buffer, size_t bufferLength, MatchAccumulator * accum);
Note: See TracChangeset for help on using the changeset viewer.